contextmenu

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

Adding children to context menu links

笑着哭i 提交于 2019-12-11 02:12:20
问题 I am trying to add children for my context menu, but for some reason it is not working for me. Here is my code: var parent1 = chrome.contextMenus.create({"title": "Trigger Rank", "contexts":["link"]}); var child1 = chrome.contextMenus.create ( {"title": "Rank 1", "parentId": parent1, "onclick": genericOnClick} ); var child2 = chrome.contextMenus.create ( {"title": "Rank 2", "parentId": parent1, "onclick": genericOnClick} ); var child2 = chrome.contextMenus.create ( {"title": "Rank 3",

How to add context menu on Raphael element?

戏子无情 提交于 2019-12-11 02:09:07
问题 I am working with ExtJS 4 framework and also using Raphael.js in my main application panel. First I was trying to prevent the regular context menu from showing, and I found out very easy solution. raphael_element.node.oncontextmenu = function() { return false; } This is working great, but before returning false I want to add some code to show my own custom menu. Does anyone know how to do that? I have something in html, that was thinking to use in the menu: <ul id="rect_menu" class=

C# DataGridView opening ContextMenu at location of Right Click

前提是你 提交于 2019-12-10 23:40:05
问题 I've looked around for quite a while now trying to find a working solution but am resorting to asking a question: I have a DataGridView in a Dialog Form in my app, that I want a ContextMenu to appear on Right-Click of Cell. I have the right-click and the ContextMenu appearing fine, however no matter what solution on StackExchange I attempt, it is always offset quite alot. Is this to do with the form and/or it's parent? Or am I just stupidly missing something here? Thanks Jamie Form.cs private

menuInfo is null when creating context menu on recycler view

半城伤御伤魂 提交于 2019-12-10 23:35:32
问题 I am trying to display a context menu on clicking item in a recycler view, and the choose to call the person whose name has been clicked. But I am unable to retrieve the phone number because the getMenuInfo() is not working bcoz I am getting a null in contextMenuInfo in onCreateContextMenu(). I have referenced many answers and written my code accordingly but still not able to correct it Here is my code: menu_actions.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http:/

menuitem and contextmenu crossbrowser compatibility

社会主义新天地 提交于 2019-12-10 23:29:06
问题 Problem 1: I had made my own contextmenu using the following piece of code. function addFullScreenMenu () { var menu = document.createElement('menu'); var item = document.createElement('menuitem'); menu.setAttribute('id', 'fsmenu'); menu.setAttribute('type', 'context'); item.setAttribute('label', 'Fullscreen'); item.addEventListener('click', function (e) { if (window.fullScreen) { document.body.mozCancelFullScreen(); } else { document.body.mozRequestFullScreen(); } }); menu.appendChild(item);

Figure out DOM Element of right click

夙愿已清 提交于 2019-12-10 19:54:01
问题 I have used the following Code Snippet to build a custom context-menu: <script type="text/javascript"> $(document).ready(function() { var x, y; document.oncontextmenu = function(e) { e.preventDefault(); x = e.clientX; y = e.clientY; $("#rkm").css("left", x + "px"); $("#rkm").css("top", y + "px"); $("#rkm").show(); }; $(document).mousedown(function(e) { if (!(e.clientX >= x && e.clientX <= (x + $("#rkm").width()) && e.clientY >= y && e.clientY <= (y + $("#rkm").height()))) { $('#rkm').hide();

Add item above “Project” in eclipse project explorer contextmenu

拜拜、爱过 提交于 2019-12-10 18:44:43
问题 I am working on an eclipse based customized IDE for our development environment. In my new perspective I have included a "Project Explorer" and in that I am able to add commands in the context menu, but when I include a new Wizard (A project Wizard) in the "new" type it is shown beneath the "Project" wizard and I'd want it to be above it. The plugin.xml for this snippet is attached <extension point="org.eclipse.ui.navigator.navigatorContent"> <commonWizard type="new" wizardId="dev.xxx.wizard

Invoke a ContextMenu to open

我只是一个虾纸丫 提交于 2019-12-10 17:57:15
问题 I need to do something like Google Maps does (but in WPF ): when RightClick on the map I have a ContextMenu. when RightDoubleClicking I have the UnZoom action. So, apparently, this is a little difficult in WPF... After struggling and searching a lot, read people that compains that "we can't predict the future" (I ask myself how does Google predict it), I decided to "wait" SystemInformation.DoubleClickTime and only then display a contextMenu. Surely, this is not ideal, even human-observable,

webview load custom context menu

本秂侑毒 提交于 2019-12-10 17:29:59
问题 I have a WebView in a window. In the WebView , I am able to restrict it to load its default contextual menu. I need to add a custom contextual menu for the WebView . So, please post a sample regarding this. I am new to Mac development. Please help me in this issue. Thanks in advance. 回答1: Assign an object as the web view's WebUIDelegate and implement this delegate method: - (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *