keyboard-shortcuts

How to Disable Copy Paste (Browser)

北慕城南 提交于 2019-11-26 09:02:00
问题 I am trying 2 alternatives: Ignore right-click Ignore ctrl + C , ctrl + A This is my code: function noMenu() { return false; } function disableCopyPaste(elm) { // Disable cut/copy/paste key events elm.onkeydown = interceptKeys // Disable right click events elm.oncontextmenu = function() { return false } } function interceptKeys(evt) { evt = evt||window.event // IE support var c = evt.keyCode var ctrlDown = evt.ctrlKey||evt.metaKey // Mac support // Check for Alt+Gr (http://en.wikipedia.org

Defining MenuItem Shortcuts

六月ゝ 毕业季﹏ 提交于 2019-11-26 08:59:44
问题 I need a simple way to set a shortcut for menu items. But this don´t work with shortcut, just with click: <MenuItem Header=\"Editar\"> <MenuItem Header=\"Procurar\" Name=\"MenuProcurar\" InputGestureText=\"Ctrl+F\" Click=\"MenuProcurar_Click\"> <MenuItem.ToolTip> <ToolTip> Procurar </ToolTip> </MenuItem.ToolTip> </MenuItem> </MenuItem> I am using WPF 4.0 回答1: You need to use KeyBindings (and CommandBindings if you (re)use RoutedCommands such as those found in the ApplicationCommands class)

Locate current file in IntelliJ

痴心易碎 提交于 2019-11-26 08:43:17
问题 How do I locate the current file in the project structure? (Similar to Visual Studio\'s Ctrl + Alt + L ). What is the name of the operation (so I can define it in the keymap) 回答1: Alt + F1 almost does what you want. You need to hit Enter afterwards as IDEA allows multiple "targets" for navigation (project structure, file structure etc). (Note you can also set AutoScroll to Source and AutoScroll from source using the two "boxes with arrows" buttons above the project structure view but this can

How to modify the keyboard shortcuts in Eclipse IDE?

情到浓时终转凉″ 提交于 2019-11-26 07:58:17
问题 Title more or less says it all. Specifically, I\'ve become increasingly annoyed that in order to run an ant script I have to use Alt + Shift + x , q . But I think If I had this power I would many things I would change the shortcuts for/add shortcuts for things that don\'t currently have them. 回答1: Window > Preferences > General > Keys In particular, edit the "Run Ant Build" command. 回答2: For Windows: Window > Preferences > General > Keys 回答3: For mac that would be Eclipse > Preferences >

Emacs on Mac OS X Leopard key bindings

懵懂的女人 提交于 2019-11-26 07:52:24
问题 I\'m a Mac user and I\'ve decided to learn Emacs. I\'ve read that to reduce hand strain and improve accuracy the CTRL and CAPS LOCK keys should be swapped. How do I do this in Leopard? Also, in Terminal I have to use the ESC key to invoke meta. Is there any way to get the alt/option key to invoke meta instead? update: While the control key is much easier to hit now, the meta key is also used often enough that its position on my MacBook and Apple Keyboard also deserves attention. In fact, I

Keyboard shortcuts in WPF

最后都变了- 提交于 2019-11-26 05:49:03
问题 I know about using _ instead of & , but I\'m looking at all the Ctrl + type shortcuts. Ctrl + Z for undo, Ctrl + S for save, etc. Is there a \'standard\' way for implementing these in WPF applications? Or is it a case of roll your own and wire them up to whatever command/control? 回答1: I understand the standard way is by creating commands and then adding your shortcut keys to them as InputGestures. This enables the shortcut keys to work even if they're not hooked up to any controls. And since

Eclipse Optimize Imports to Include Static Imports

天大地大妈咪最大 提交于 2019-11-26 04:56:41
问题 Is there anyway to get Eclipse to automatically look for static imports? For example, now that I\'ve finally upgraded to Junit 4, I\'d like to be able to write: assertEquals(expectedValue, actualValue); hit Ctrl + Shift + O and have Eclipse add: import static org.junit.Assert.assertEquals; Maybe I\'m asking too much. 回答1: I'm using Eclipse Europa, which also has the Favorite preference section: Window > Preferences > Java > Editor > Content Assist > Favorites In mine, I have the following

Keyboard shortcuts in WPF

烂漫一生 提交于 2019-11-26 03:23:18
I know about using _ instead of & , but I'm looking at all the Ctrl + type shortcuts. Ctrl + Z for undo, Ctrl + S for save, etc. Is there a 'standard' way for implementing these in WPF applications? Or is it a case of roll your own and wire them up to whatever command/control? Abby Fichtner I understand the standard way is by creating commands and then adding your shortcut keys to them as InputGestures. This enables the shortcut keys to work even if they're not hooked up to any controls. And since menu items understand keyboard gestures, they'll automatically display your shortcut key in the

javascript capture browser shortcuts (ctrl+t/n/w)

佐手、 提交于 2019-11-26 02:31:31
问题 Is it possible to capture these shortcuts? Ctrl + N Ctrl + T Ctrl + W I tried this but it doesn\'t work: $(window).keydown(function(event) { console.log(event.keyCode); event.preventDefault(); }); When I press T it shows 84 in the console, but if I press Ctrl + T it shows nothing, and opens a new tab. I would like to capture these shortcuts and prevent any browser action. 回答1: Capturing Ctrl keyboard events in Javascript Sample code: $(window).keydown(function(event) { if(event.ctrlKey &&

Keyboard shortcuts with jQuery

随声附和 提交于 2019-11-26 01:46:30
问题 How can I wire an event to fire if someone presses the letter g ? (Where is the character map for all the letters BTW?) 回答1: Since this question was originally asked, John Resig (the primary author of jQuery) has forked and improved the js-hotkeys project. His version is available at: http://github.com/jeresig/jquery.hotkeys 回答2: What about jQuery Hotkeys? jQuery Hotkeys lets you watch for keyboard events anywhere in your code supporting almost any key combination. To bind Ctrl + c to a