keypress

Receiving key press and key release events in Linux terminal applications?

I would like to write a simple C program that will perform different actions based on both "key down" and "key up" events. This program will be run from inside rxvt. What library or mechanism should I use to access both key presses and releases? Is it true that reading /dev/tty will only provide key releases? Is this also true for termc...

Help: Maximum number of clients reached - Segmentation fault

I want to simulate many key press events. I found a solution by using XTestFakeKeyEvent, but when I simulate more than 210 times my program raises a "Maximum number of clients reached" segmentation fault. I don't known how to solve this problem. My code here: #include <X11/Xlib.h> #include <X11/keysym.h> #include <X11/extensions/XTest....

jquery keypress() event get text

I want a function to be run when a keypress occurs on a text box, so I have this code: $("input[x]").keypress(function() { DoX(); }) This is working fine, but in my function I want to do something based on the text value in the textbox var textValue = ("input[x]").val(); Now the problem here is that it lags behind by a ...

Detecting Key Presses

I am writing a program that expands the usage of the clipboard, but I need to tell when the user has either cut, copied, or pasted something so I can write code accordingly to that. I need to know how I can check to see when the user has entered a command like this. ...

How to know when a user has really released a key in Java?

(Edited for clarity) I want to detect when a user presses and releases a key in Java Swing, ignoring the keyboard auto repeat feature. I also would like a pure Java approach the works on Linux, Mac OS and Windows. Requirements: When the user presses some key I want to know what key is that; When the user releases some key, I want to ...

Adobe Flex key capturing

In my Flex application when click F11 key the page gets into full screen and disturbs the shape of the page.Can anyone help me out in capturing the F11 key .I am using IE7. ...

Jquery: how to detect a textbox's content has changed

I want to detect whenever a textbox's content has changed. I can use the keyup method, but that will also detect keystrokes which do not generate letters, like the arrow keys. I thought of two methods of doing this using the keyup event: Check explictly if the ascii code of the pressed key is a letter\backspace\delete Use closures to r...

Can you get a keypress event for the phone call key in Flash Lite?

All mobiles have a green dialing key. Do you get an event for this in Flash Lite 3.0 or above? ...

Restricting enter keypress event in an IFrame, does not work

I have an IFrame within my page and am using the designMode="on" on this iframe for a small-level rich text editing. My concern is that I need not allow the user to enter new lines in it - meaning, I want to restrict enter keys. I did it using the question posted here to listen to the keypress events. But in my keypress event, if I ret...

Javascript: Adjust date in textbox using keypress event

I have a standard <input> textbox where users enter a date. I'd like to add some functionality where users can enter + or - to add/subtract a day from the value. I added an onkeypress event that calls this function: function adjustDate( element ) { var e = event || window.event; var code = e.charCode || e.keyCode; switch( ...

Is there any event between keypress and keyup in javascript?

I have a situation where I need to intercept every key thats being pressed in to a contentEditable div. But when the keypress event happens, if I do, document.getElementById("divEditor").innerHTML I cannot get the full text (does not have the last character pressed) Also, keyup event doesn't fire for continuous keypresses. What can I...

Detecting multiple simultaneous keypresses in C#

I am looking to emulate hyperterminal functionality for my Serial Communication in C# by detecting the keypresses of certain key combinations (escape sequences) which cannot be typed out such as Ctrl+C, Ctrl+Z, etc. I understand that these keys have their ASCII equivalents and can be transmitted as such. But I am facing problems with the...

Not sure how to get the 'final' output from a WinForm KeyPress event.

Hi folks, I've got a simple winform. In it has a single TextBox control. In that, i've wired up the KeyPress event. Why? I'm trying to capture everything the user types in that textbox. But, when they hit return or enter, i then grab everything they've typed and send it to a command parser to do stuff. I then display on the screen (in ...

python - get a key press from the linux command line without having to press enter

I'm writing a command line python programme on linux. I want to ask the user to press a single key, and then it should return that key press. I don't want them to have to press enter, so I can't use the builtin raw_input() method. ...

Disabling key functionality in browser

I am writing an application in JavaScript (w/ JQuery). The application has a lot of functionality that the user needs to access quickly and possibly at the same time (you could think of it as a game, even though it's not a game) so I've set it up to use the keyboard. I've got a prototype of the system working (in Chrome, at least), but...

asp.net-mvc ajax query on keypress rather than submit button

I am using Ajax.BeginForm to update data on a webpage (as per the code below). Is there anyway i can hit the backend server on every keypress instead of waiting for hitting the submit button this way, when i type "a", it will query on "a' and show all the db results then if i type "b" it will filter the list on "ab" and so forth . . ...

Override Keybindings

I'm trying to make it so no matter what, when I push Space, a certain block of code is executed (cmd_play, to be exact). However, it only seems to work once if you do it using Form Keypress: private void frmmain_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == Convert.ToChar(Keys.Space)) ...

Excluding form fields from keypress handler assigned to body

I have a keypress handler on a web page assigned to the body element. I really do want it to be active anywhere in the web page. Or so I thought. The keypress events in textual input forms also activate the body handler, which makes sense, but which I don't want. Ideally, I'd like to keep the keypress handler assigned to the body ele...

Can I intercept control-A keypresses on IE?

I'm trying to use jQuery to intercept control-A keypresses on my web page, like so: $(document).keypress(function (event) { if (event.ctrlKey && (event.which == 65 || event.which == 97)) { event.preventDefault(); // ... } }); This works on Firefox, but on IE7, my event handler doesn't get called, and all of the...

Catching Enter Keypress from a CComboBox

Once a user types something in to my CComboBox (within a CDialog subclass) and presses Enter, I would like to add what they've written to the list of options, and do some other handling. How do you do that in MFC? ...