hotkeys

appending text in textarea with hotkeys and javascript

孤街醉人 提交于 2021-02-11 17:01:22
问题 I have 4 input text tags and 4 textarea tags and I need to create some hotkey like Ctrl+n, Ctrl+r and Ctrl+o to append predefined words at the cursor position for all text fields. I got this script but is only for onclick event, so I want just to show just one time for the user the text (Press Ctrl+n for word1, Ctrl+r for word2 and Ctrl+o for word3) then he can insert those words every time he is typing some text whatever the field he is. <script> function addText(event) { var targ = event

Keystroke/Hot Key for JButton in Java

我是研究僧i 提交于 2021-02-10 07:14:25
问题 Initially I was using JMenu and establishing hot keys to work using accelerator. It was working perfectly. Now I want the same behavior in JButton but I am stuck. Here is the code that I wrote : Please share your ideas so I can go in the right path. import javax.swing.*; import java.awt.Event; import java.awt.event.*; import java.util.Arrays; public class ShowDialogBox{ JFrame frame; public static void main(String[] args){ ShowDialogBox db = new ShowDialogBox(); } public ShowDialogBox(){

How do I implement Ctrl+Z / Command+Z in Java/Swing?

假如想象 提交于 2021-02-07 13:26:56
问题 I'm working on a little Java applet that needs undo/redo functionality. Here's code to set up the hotkeys (works great on Windows). My question is: how do I make it use command+Z on mac? Should I just check System.getProperty("os.name") or is there a more elegant alternative?? private void setupUndoHotkeys() { String UNDO = "Undo action key"; String REDO = "Redo action key"; Action undoAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { undo(); } }; Action redoAction

Global Hooks (non-active program)

女生的网名这么多〃 提交于 2021-02-07 04:29:40
问题 I am creating a program that allows you to paste text but it will look like you are typing it as it pastes, Paste Typer. I am wanting to use Ctrl + b to set off the pasting, but I am having issues with hotkeys. I think what I need is to use a WH_KEYBOARD_LL hook and include that user32 file but I usually get errors when I add it and the namespace. I have come closest with this: http://thedarkjoker94.cer33.com/?p=111 - but it doesn't seem to work with Ctrl , alt and other modifiers, even when

How do I hook global shortcuts in Windows?

与世无争的帅哥 提交于 2021-02-07 03:40:15
问题 I remember using a program, some years back, that allowed me to fine-tune my monitor's settings with custom gamma ramps and other adjustments. It had the ability to create different screen-settings profiles for different uses, and setup global hotkey shortcuts to activate them without switching out of the program you're in. My question is, how do you set up the hook for that? I'm sick of WINDOWS-D minimizing everything when I only want access to the desktop in one screen and I want to keep

How do I hook global shortcuts in Windows?

别等时光非礼了梦想. 提交于 2021-02-07 03:37:45
问题 I remember using a program, some years back, that allowed me to fine-tune my monitor's settings with custom gamma ramps and other adjustments. It had the ability to create different screen-settings profiles for different uses, and setup global hotkey shortcuts to activate them without switching out of the program you're in. My question is, how do you set up the hook for that? I'm sick of WINDOWS-D minimizing everything when I only want access to the desktop in one screen and I want to keep

How do I hook global shortcuts in Windows?

不想你离开。 提交于 2021-02-07 03:36:59
问题 I remember using a program, some years back, that allowed me to fine-tune my monitor's settings with custom gamma ramps and other adjustments. It had the ability to create different screen-settings profiles for different uses, and setup global hotkey shortcuts to activate them without switching out of the program you're in. My question is, how do you set up the hook for that? I'm sick of WINDOWS-D minimizing everything when I only want access to the desktop in one screen and I want to keep

Javascript -> Hotkeys -> Disable for input fields

China☆狼群 提交于 2021-02-04 21:09:35
问题 okay so I have the hotkey working just can't make it stop $(document).keypress(function(e){ if(e.which == 13){ //Enter key is press do what you want } else if(e.which == 67 || e.which == 99){ //C key is press do what you want window.location.href = "/html/credits.php"; } else if(e.which == 32){ alert("Space pressed"); } }); $("input.registerform").keypress(function(e){ e.stopPropagation(); }); Here is what I have to make it stop, the class of my input form is "registerform bgcolor2" but it

Javascript -> Hotkeys -> Disable for input fields

孤街浪徒 提交于 2021-02-04 21:09:22
问题 okay so I have the hotkey working just can't make it stop $(document).keypress(function(e){ if(e.which == 13){ //Enter key is press do what you want } else if(e.which == 67 || e.which == 99){ //C key is press do what you want window.location.href = "/html/credits.php"; } else if(e.which == 32){ alert("Space pressed"); } }); $("input.registerform").keypress(function(e){ e.stopPropagation(); }); Here is what I have to make it stop, the class of my input form is "registerform bgcolor2" but it

Javascript -> Hotkeys -> Disable for input fields

萝らか妹 提交于 2021-02-04 21:09:14
问题 okay so I have the hotkey working just can't make it stop $(document).keypress(function(e){ if(e.which == 13){ //Enter key is press do what you want } else if(e.which == 67 || e.which == 99){ //C key is press do what you want window.location.href = "/html/credits.php"; } else if(e.which == 32){ alert("Space pressed"); } }); $("input.registerform").keypress(function(e){ e.stopPropagation(); }); Here is what I have to make it stop, the class of my input form is "registerform bgcolor2" but it