keyboard-events

Is it possible to map a key press to simulate middle-click in xwindows?

Hey, I'm wondering, is it possible to somehow map a key-press event to act like a middle-key click of a mouse in Xwindows? They are diffrent devices, I know, but if there was a way to trigger a middle-button click event from a C program, it should be easy to bind a key to it using existing xwindows mechanisms. ...

How to get keypressed, keydown events from DataGridView data cells

Hi. I need to receive the key press events during cell editing in DataGridView control. From what I have found on the net the DataGridView is designed to pass all key events from DataGridView to the cell editing control and you cannot get these events easily. I found this piece of code that traps those events for DataGrid control, but...

Are there any pre-built Javascripts for checking keyboard/mouse activity?

I need a Javascript which monitors keyboard and mouse events to track how much time a user spends on the page. Specifically, actively using the page by typing, or moving/clicking with the mouse. Thought I'd ask if anybody knows of something that might work for me to save some time. Otherwise, Javascript and Aspirin here I come... lol ...

Read keyboard characters to determine shortcuts

I'm working on a document application and part of this application I've to add support to read the keyboard pressed events and replace the pre-defined characters set if that keyboard entry is match with the pre-defind short form/word.The actual application has implemented in C++. Please provide me your thoughts on how to implement this....

Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser

I want to handle F1-F12 keys using JavaScript and jQuery. I am not sure what pitfalls there are to avoid, and I am not currently able to test implementations in any other browsers than Internet Explorer 8, Google Chrome and Mozilla FireFox 3. Any suggestions to a full cross-browser solution? Something like a well-tested jQuery library ...

AS3: Detect long key presses

I have an interface that needs to react to "long key presses". That means 2 different actions for the same key based on how long the key has been down: PRESS LEFT CURSOR: action A PRESS & HOLD LEFT CURSOR: action B Well, it's proving harder that I thought. The main problem is that both Keyboard.KEY-DOWN and Keyboard.KEY-UP fire contin...

PyGame not receiving events when 3+ keys are pressed at the same time...

I am developing a simple game in PyGame... A rocket ship flying around and shooting stuff. Question: Why does pygame stop emitting keyboard events when too may keys are pressed at once? About the Key Handling: The program has a number of variables like KEYSTATE_FIRE, KEYSTATE_TURNLEFT, etc... When a KEYDOWN event is handled, it ...

Sending string (of characters) to active window

I wrote a simple program that reads the characters from external device (bar code scanner) from serial port (/dev/ttyS1) and feeds it to the currently active window (using XSendEvent). Program works fine on faster computers, but on slow ones the situation happens (very often) that characters don't get received in the same order they wer...

How to specify kbd modifiers with SendInput()?

I'm using the Windows API SendInput() call to simulate keyboard events. The following snippet (irrelevant details omitted) works perfectly for sending a sequence of characters: wchar_t txt = ...; INPUT *input = ...; size_t nInput = 0; for (unsigned int j = 0; j < length; j++) { input[nInput].ki.wVk = 0; input[nInput].ki.wScan ...

All keys to a list, for example VK_A..Z for user to select

Hello All, I am making a program that allows user to custom keyboard shortcuts, for this i need the available keys to be displayed, what is the best way to achieve this in java swing? KeyEvent.class.getDeclaredFields() I am intrested in dynamic example of below, keysLST.setModel(new javax.swing.DefaultComboBoxModel(new String[]...

Is there a cross-platform python low-level API to capture or generate keyboard events?

I am trying to write a cross-platform python program that would run in the background, monitor all keyboard events and when it sees some specific shortcuts, it generates one or more keyboard events of its own. For example, this could be handy to have Ctrl-@ mapped to "my.email@address", so that every time some program asks me for my ema...

How to capture enter key being pressed on pages containing multiple forms?

I have inherited a web application where the usual ability to press return in any of the input fields has been disabled for the very good reason that the page contains multiple forms, and the application would not be able to determine (or, so I am told) which form to action. The application has been designed so there are no submit button...

Keyboard Input Counting in Javascript and Python

i'm new with javascript and python. Does anyone know how to dynamically display number of keys pressed, on the screen. thanks ...

Ruby Keyboard event handling

Hello im using curses to develop a small console application. I have a main loop section wich waits for user input, it uses the getstr function, of course this waits for the user to press enter. I would like to capture the up and down and tab keypresses. I suppose this can't be done with getstr. Anyone have any idea how to do this? ...

Keyboard input in PHP

I am trying to control stuff with PHP from keyboard input. The way I am currently detecting keystrokes is with: function read() { $fp1=fopen("/dev/stdin", "r"); $input=fgets($fp1, 255); fclose($fp1); return $input; } print("What is your first name? "); $first_name = read(); The problem is that it is not reading t...

How do I detect the 'delete' key in my Field subclass?

I'm trying to detect and override the Delete key on the Blackberry keyboard. For some reason, it never makes it inside my case statement as when it hits that point: Keypad.key(keycode) == 8 Keypad.KEY_DELETE == 127 What's my error? public class MyField extends ListField implements KeyListener { // ... /** Implementation of KeyListen...

Firing a Keyboard Event in JavaScript

I'm trying to simulate a keyboard event in Safari using JavaScript. I have tried this: var event = document.createEvent("KeyboardEvent"); event.initKeyboardEvent("keypress", true, true, null, false, false, false, false, 115, 0); ...and also this: var event = document.createEvent("UIEvents"); event.initUIEvent("keypress", true, true,...

Windows XP Original Keyboard Driver Source Code, or similar; is it available?

I'm looking for information on the input devices related to windows default keyboard and in the future mouse drivers. I've seen the code for keyboard filter drivers, but I want to write the actual keyboard driver, not just a filter that can monitor actions created by a keyboard. It would be amazingly useful to see the source code of exi...

Keyboard events for child elements in a contenteditable div?

I have a div who's contenteditable property has been set to true.How do I get the children to respond to keyboard events? Seems like the only way is to capture the events in the parent div and figure out the child via the selection apis. Is there a better way? More specifically, can I attach a keyboard event handler to child elements? Am...

Android: Keyboard event handler

Hi, I created a full-screen application and set the default orientation to landscape. When I open the keyboard the application crashes therefore I would like to override the method which executes on keyboard slide. Does anyone know which method is that? Thanks! ...