keyboard-events

How to unit test jQuery keyboard events?

Is there a way to test JavaScript keyboard event handlers (for keypress, keyup, keydown events)? I know I can declare event handlers like this: function keyUpEvHandler(e) { ... // code here } $('#myId').keyup(keyUpEvHandler); and then just run this function in unit tests, but I will have to prepare event argument object to be th...

Winform keyboard management

I would like to control the focus of my winform application. It is made of a custom listbox and several other component. I want all the keyboard event be managed by my window handlers in order to avoid specific control key handling (for example when I press a character and the list box is focused, the item starting with the correspondant...

.NET, and "know" when a keyboard button is being pressed

I'm making a program in C#, And I want to know when the user is pressing\pressed a keyboard button (for now: 1-9 buttons on keyboard). How can I do it? ...

Why doesn't my form's OnKeyDown event handler fire?

I'm using Delphi 2009 and I followed a tutorial at delphi.about.com, but I couldn't set it. I created an event OnKeyPress/OnkeyDown and set a breakpoint to see if the event is called, but it's not being called in any way. Where is the problem? EDIT: procedure TFormMain.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState)...

Applying a modifier key from one keyboard to a keypress on another in OS X

I want to use a foot pedal to press the key, but OS X won't associate a modifier keys across two different devices. I've found some applications that create virtual keyboards, such as synergy+, so I know it must be possible to capture events from 2 devices and merge them as if they were coming from one device. Any ideas on how I can mak...

Intercept media keys on ASUS laptop

Hello, I have an ASUS laptop (F50SF) and I was playing around in C++ trying to intercept the multimedia keys (next track, previous track, play/pause, etc.), but I cannot figure out exactly how to do this. I tried GetAsyncKeyState(VK_MEDIA_NEXT_TRACK) but to no avail. I know it is possible (and that the keys are working in the first pla...

How to hook IE keyboard event?

I am trying to disable browser shortcuts while user tries to press some combination of keys on the swf file. Although I can achieve this in firefox, below code does not function in ie 8. Below code is able to hook the keyboard events if focus is not on the swf file. However, what I need is hooking keyboard events when user operates on sw...

How to respond to password prompt when using SCP in a shell script?

First of all, I am well aware of that there are many of questions regarding this topic. I have read them, but still could figure out an appropriate answer for my situation. I would like to scp the entire ~/cs###/assign1 dir from local to school home dir with a shell script. My question is, is there a way in my script to wait for the pas...

Shift+Ctrl+0 key combination not seen by application on Windows Vista

I start with a new Delphi VCL application, add Menus to the uses clause, drop a label on the form, and assign the form's OnShortCut event: procedure TForm1.FormShortCut(var Msg: TWMKey; var Handled: Boolean); begin Label1.Caption := ShortCutToText(ShortCut(Msg.CharCode, KeyDataToShiftState(Msg.KeyData))); end; On XP, this works corr...

Forcing javascript keyboard event inside a textarea on IE

Hi I'm trying to force a keypress inside a textfield using javascript. This has to work specifically on IE but it simply doesn't work. Can anyone help me? My test script is this one: <html> <body> <input type="text" id="txtfld"> <input type="button" onclick="go()"> <script> function go() { var q = document.getElemen...

getting keyboard events without the window being focused

i want to get keyboard events without having focus. my application is a background application and should send "space" key to another app when user presses CTRL+space in any application. i use .NET and i use C# as language. ...

Move focus in response to keyboard events in XAML

I've got a WPF view with two textboxes. I'd like to automatically move focus forward from the first textbox to the second when the user hits the down arrow on the keyboard exactly like Tab does. It seems like I ought to be able to do this 100% declaratively, but for some reason the commands I thought would do this don't seem to do anyt...

intercepting keystrokes in OSX

I'd like to be able to listen to keystrokes systemwide in OSX to implement an utility like AHK on windows (the shortcuts part of AHK anyway), recognizing not only simply combinations of keys, but even more complex things like sequences etc.. I need someone to point me... where to start? How to listen to keybard events system wide? Maybe...

How to raise mouse and keyboards events in JS

Is there a way to send mouse events and keyboard events in JavaScript? Does all browsers support this need? -Datte ...

Try to implement global keyboard shortcut in MDI parent/child form and other form by using ProcessCmdKey

I override ProcessCmdKey() in my MDI parent form class and have some keyboard shortcut calling method in same class. But I wish to make these hotkeys working in parent/child form and other form. The case now is when focus on the other form(regular form, not MDI), ProcessCmdKey() doesn't capture keyboard anymore. Which class should I put ...

How to prevent Jquery keydown/keyup events returning multiple events when a key is mapped to multiple characters?

$(document).ready(function() { $(document).keyup(function(e) { alert('This key: ' + e.keyCode); }); }); If an individual key is mapped to multiple characters, then the keyup event will execute multiple times for one key press. Does anyone know how to identify just the physical act of pressing the key in this instance? ...

How to stop repeated keyPressed() / keyReleased() events in Swing

So the problem that I am having appears to be a bug that occurs only on Linux. I'm trying to have my swing app record when a key is pressed down, then to detect when that key is released. Now that shouldn't be in issue because KeyListener is supposed to handle this for me. The problem is that when I hold the key down I get lots of repea...

Send a key press to an active app problem

I want to send keypresses from c# app to an active app (in my case Frets on Fire). The problem is that my code is working with most apps I tried, but not with the actual app I'm aiming for. Here's my code: while (true) { SendKeys.SendWait("{F1}"); Thread.Sleep(500); } What might prevent the specific app from taking the c# keys...

Detect a double key press in AutoHotkey

I'd like to trigger an event in AutoHotkey when the user double "presses" the escape key. But let the escape keystroke go through to the app in focus if it's not a double press (say within the space of a second). How would I go about doing this? I've come up with this so far, but I can't work out how to check for the second escape key...

Can not use keyboard input to a textbox control in Silverlight 3 when the application is in full screen mode

It appears when I move the application into full-screen mode - I cannot enter text into a text box control. It seems that the keyboard events are being ignored. I have found an article here (http://forums.silverlight.net/forums/t/142460.aspx) documenting the same problem. I also have read that in Silverlight 4 if an application is trust...