right-click

Detectinig the target of the click using JavaScript?

纵然是瞬间 提交于 2019-12-12 17:24:30
问题 How do I detect what object or ID or the user right-clicked on? I'm using the onContextMenu to trigger a function but I don't know how to detect the target. 回答1: <html> <head> <script type="text/javascript"> if (document.addEventListener) { document.addEventListener('contextmenu', function(e) { alert(e.target.nodeName); //or e.target.getAttribute('id') e.preventDefault(); }, false); } else { document.attachEvent('oncontextmenu', function(e) { alert(window.event.srcElement.nodeName); //or e

right click on grid row

南笙酒味 提交于 2019-12-12 03:53:07
问题 problem is , that whenever the grid's row is right clicked the selected item is null.how do i make a the grid's row selected when any row was right clicked? thanks Jamal 回答1: I think the solution may have a problem. Every time a row is loaded it will add an event handler, so if the row is ever reused it can accumulate event handlers. I would recommend removing the event handler when the row is unloaded. Here's my suggested code: private void dg_LoadingRow(object sender, DataGridRowEventArgs e

How do i automate the simulation of right clicking a file and selecting the first option using vbscript

北城余情 提交于 2019-12-12 03:38:02
问题 Currently i am doing this.But this is not working,just creating a shortcut of the vb script. Dim objShell Set objShell = WScript.CreateObject ("WScript.shell") objShell.Run "E:\folder\xyz.cmd" objShell.Sendkeys ("+{F10}") objShell.Sendkeys "s" Set objShell = Nothing Can some one please help me on this.Thanks 回答1: This uses the shell's COM objects. We choose the verb we want. Run the script without arguments for help. To list verbs shverb.vbs "E:\folder\xyz.cmd" To Open shverb.vbs "E:\folder

Python: 'Right click' a file in File Explorer to bring up context menu and 'left click' an option from that menu

╄→гoц情女王★ 提交于 2019-12-11 16:03:24
问题 My goal is to be able to 'right click' a file in file explorer, bring up the context menu and 'left click' to select an option from that menu. My, so far unsuccessful idea, has been to use os.system to get into command prompt from os import system system(r'cd C:\Users\UserName\Documents && RIGHT CLICK SOME DOCUMENT AND SELECT AN OPTION') But my idea falls short after the && in the above raw string. Where usually just putting a filename e.g. 'doc.txt' after the && would left click and open the

How in OpenEdge ABL / Progress 4GL do I find the row id of a row that is right clicked in a broswer

会有一股神秘感。 提交于 2019-12-11 06:02:51
问题 How in OpenEdge ABL / Progress 4GL do I find the row id of a row that is right clicked in a browser. 回答1: I'm not sure if this is what you're looking for, but I hope it will be useful to someone. I wanted to respond to the mouse's Right-click in a browse. Right-clicking does not select the row you're clicking on, so I had to programatically figure out which row it was. This goes in the MOUSE-MENU-DOWN event of the browse: DEFINE VARIABLE iRowHeight AS INTEGER NO-UNDO. DEFINE VARIABLE iLastY

capture right click through Javascript, withouth wmode

对着背影说爱祢 提交于 2019-12-11 03:14:32
问题 Flash player has a bug in using anything other than wmode="window" in Firefox/Chrome when using any other language than English. This bug is reported and not fixed yet http://bugs.adobe.com/jira/browse/FP-501 The issue can be seen better here - http://www.5etdemi.com/blog/archives/2005/06/firefox-wmodetransparent-is-completely-screwy-and-breaks-textfields/ Now to my problem - im trying to use Uza's right click solution ( http://www.uza.lt/blog/2007/08/solved-right-click-in-as3 ) in my

Catch Right-Click AS3

家住魔仙堡 提交于 2019-12-11 02:28:16
问题 Is it possible to catch a right-click inside of flash (AS3)? No JQuery/JavaScript. I need to pause gameplay when a right-click is caught, so I don't so much want to disable the context-menu as I do just want to tell that a right-click has happened. Is there an EventListener I can add? Any other ideas? UPDATE: I need the event to be triggered as they are actually right clicking, not just after the context-menu has disappeared. 回答1: There are only two ways to capture a right click event: For a

How to differentiate between 'right click using mouse' AND 'context menu key press on physical keyboard'

喜你入骨 提交于 2019-12-11 02:21:56
问题 How do I differentiate between right click using mouse and context menu key press on a physical keyboard? Using this code I tried printing event in console $('#'+inputId).bind('contextmenu', function(e) { console.log(e); }); I grabbed some output for the above code- For right click using the mouse it is- button: 2 originalEvent: MouseEvent type: "contextmenu" which: 3 For context menu key press on the keyboard it is- button: 2 originalEvent: MouseEvent type: "contextmenu" which: 3 I want to

right click menu option in the tree root node

这一生的挚爱 提交于 2019-12-11 02:03:49
问题 I want right click menu option in the tree root node(JavaFX). Could any one help me on this. TreeItem<String> root = new TreeItem<>(""+selectedDirectory); root.setExpanded(true); locationTreeView.setRoot(root); root.getChildren().addAll( new TreeItem<>("Item 1"), new TreeItem<>("Item 2"), new TreeItem<>("Item 3") ); 回答1: You can perform the desired behaviour in two steps: Defining a custom TreeCell factory on your TreeView ; Attaching a context menu on the TreeCell of the root tree item. The

KineticJS: right click fires click

扶醉桌前 提交于 2019-12-10 09:43:50
问题 I'm using Kineticjs and I'm defining a rect event like this this.rect.on('click tap', function(){ foo(); }); The event is fired when I left-click, but also when right-click. How can I avoid to fire this event with right-click? (I can't disabled the right-click in the page because I want to open a context menu if I rightclick over the rect) Thank you 回答1: You need to filter out right mouse click this.rect.on('click tap', function(e){ // 1:left, 2: middle, 3: right, for IE 8, e.button != 2 if