right-click

Right-click “Open” with arguments

匆匆过客 提交于 2019-11-28 14:41:11
I would like to add an entry to the Windows right-click menu that only appears when I right click on a .exe or .msi file. If the entry is selected, the exe file will be executed (like Open) but with a fixed text string as its argument. I guess this should be possible with a registry key - any ideas how to do this? For an .exe file, you can do the following in the registry: Under HKEY_Classes_Root , find key .exe Read the (Default) value (this is usually exefile ) Under HKEY_Classes_Root , find key exefile (or whatever you found in step 2) Under exefile\shell create a new key, with a name

How to distinguish between left and right mouse click with jQuery

梦想与她 提交于 2019-11-28 13:15:55
How do you obtain the clicked mouse button using jQuery? $('div').bind('click', function(){ alert('clicked'); }); this is triggered by both right and left click, what is the way of being able to catch right mouse click? I'd be happy if something like below exists: $('div').bind('rightclick', function(){ alert('right mouse button is pressed'); }); Acorn As of jQuery version 1.1.3, event.which normalizes event.keyCode and event.charCode so you don't have to worry about browser compatibility issues. Documentation on event.which event.which will give 1, 2 or 3 for left, middle and right mouse

wpf listview right-click problem

依然范特西╮ 提交于 2019-11-28 10:08:54
so I have attached a context menu (right-click menu) to a wpf listview. unfortunately, when you right-click it brings up both the menu and selects whatever item you are over. Is there a way to shut off this right-click select behavior while still allowing the context menu? The key is setting the PreviewMouseRightButtonDown event in the correct place. As you'll notice, even without a ContextMenu right clicking on a ListViewItem will select that item, and so we need to set the event on each item, not on the ListView. <ListView> <ListView.ItemContainerStyle> <Style TargetType="{x:Type

Jquery/JS prevent right click menu in browsers

て烟熏妆下的殇ゞ 提交于 2019-11-28 06:09:48
I have my div with a right click popup menu: // Attatch right click event to folder for extra options $('#fBox' + folderID).mousedown(function(event) { if (event.which == 3) { // Set ID currRClickFolder = folderID; // Calculate position to show popup menu var height = $('#folderRClickMenu').height(); var width = $('#folderRClickMenu').width(); leftVal = event.pageX - (width / 2) + "px"; topVal = event.pageY - (height) + "px"; $('#folderRClickMenu').css({ left: leftVal, top: topVal }).show(); } }); But the browser for this element still pops up the default menu (copy/paste/properties etc). Any

Dojo DataGrid Context Menu onRowContextMenu displays even when right-clicking in BLANK area of DataGrid

旧街凉风 提交于 2019-11-28 06:02:28
问题 I have a DataGrid that has items in it. When you right-click on one of the rows, a Dojo Context Menu is displayed with the option to delete that row. If you try to right-click on a blank area of the DataGrid, the context menu is NOT displayed.... BUT, if you first right click on a row, and then click the Cancel menu option (which does nothing) or if you left-click somewhere else on the page (which hides the Context Menu) and the go to right click on a blank area of the DataGrid, the Context

Java Swing JTable; Right Click Menu (How do I get it to “select” aka highlight the row)

☆樱花仙子☆ 提交于 2019-11-28 05:19:59
Short: I need a "right-click event" to highlight the cell row. I am using a JTable inside a ScrollPane in Java Swing (Netbeans Matisse). I have a MouseClicked event listener on the JTable that does the following: if (evt.getButton() == java.awt.event.MouseEvent.BUTTON3) { System.out.println("Right Click"); JPopUpMenu.show(myJTable, evt.getX(), evt.getY()) } The problem is... whenever I execute a right click on the JTable, the row isn't highlighted (I set the selection to rows only btw). I have looked for several setSelected() functions but could not find a suitable one. By default, left

Detecting a context-menu paste in the browser with jquery

╄→尐↘猪︶ㄣ 提交于 2019-11-27 18:35:22
问题 I am trying to check the length of the text in a textarea when someone pastes content in there via the right-click but can't seem to find how to do it. 回答1: $('textarea').bind('paste', function() { var that = this; setTimeout(function() { var length = that.value.length; alert(length); }, 0); }); Live demo: http://jsfiddle.net/4UrE3/1/ Works in Firefox 3.6, Chrome, Safari and IE9 beta. Does not work in Opera. 来源: https://stackoverflow.com/questions/4702814/detecting-a-context-menu-paste-in-the

Java Mouse Event Right Click

北慕城南 提交于 2019-11-27 18:14:25
On my three button mouse MouseEvent.BUTTON2 = Middle Click and MouseEvent.BUTTON3 = Right Click. Is this the case on a two button mouse? Thanks To avoid any ambiguity, use the utilities methods from SwingUtilities : SwingUtilities.isLeftMouseButton(MouseEvent anEvent) SwingUtilities.isRightMouseButton(MouseEvent anEvent) SwingUtilities.isMiddleMouseButton(MouseEvent anEvent) Codemwnci Yes, take a look at this thread which talks about the differences between platforms. How to detect right-click event for Mac OS BUTTON3 is the same across all platforms, being equal to the right mouse button.

JS: detect right click without jQuery (inline)

烈酒焚心 提交于 2019-11-27 14:10:50
问题 I'm calling a function, that builds a table which includes several links. I want to check if a link has been clicked with right or left mouse. I tried to add the following part to the <a> hyperlink. onmousedown="function mouseDown(e){ switch (e.which) { case 1: alert('left'); break; case 2: alert('middle'); break; case 3: alert('right'); break; } }" But nothing happens If I click on a link. 回答1: The html: <a href="#" onmousedown="mouseDown(event);">aaa</a>​​​​​​​​​​​​​​​​​​​​​​​​​​​ The

Disable a right click (press and hold) in WPF application.

一个人想着一个人 提交于 2019-11-27 13:09:47
问题 I am working on the touch screen application which is running on Windows XP Standard. With current hardware to invoke a right click user has to click and hold for couple of seconds, but this might interfere with other actions like holding a repeat button in the scrollviewer, so I have decide to disable a right click. I would ideally wan't to disable a right click on the application level, but if it is not possible, disable right click on windows level would also work for me. 回答1: You can