keypress

Javascript on second keypress

Hi I've been wondering if there was a simple way to detect if a user presses the same character on the keyboard twice within one second. I've written some code that kind of works but it's unreliable. var escapeCount = 0; function reset() { escapeCount = 0; setTimeout('reset();', 1000); } window.onload = function() { reset...

C#: Trouble with Form.AcceptButton

Hi all, I have a form with an button which is set as the AcceptButton of the form. The form has several other controls. Now when I press Enter on other controls the form gets closed because of the accept button on the form. Same goes for CancelButton. How do I handle this. I tried hooking on to keypress keydown event of the form and con...

How do I use CGEventKeyboardSetUnicodeString with multiple characters?

I'm trying to use event taps to create an OS X program that will listen for Yiddish typed in transliteration and post the result in Hebrew characters. I made a very short program to test one things I'd have to do: http://pastie.org/791398 As is, the program successfully replaces every typed 'q' with 'w': if(inputString[0] == 'q') { in...

Greasemonkey Javascript Key Press Help

So I'm currently trying to make a GreaseMonkey script that will allow a user to press left or right on their keyboard and have that go to a previous comic strip or go to the next strip. I currently have some code up but it's not giving me any results. function KeyCheck() { var KeyID = event.keyCode; alert(KeyID); } document.onKeyDown =...

How to get Keypress event in Windows Panel control in C#

i want to get keypress event in windows panel control in c#, is any body help for me... ...

keypress bug in FF ?

$('input').keypress(function(e){ var k = e.keyCode ? e.keyCode : e.which; console.log(k); }); <input type="text" name="" autocomplete="off"/> In FF for '.' (point) and for 'delete' it is the same code 46. AND for 'right' (right arrow) and for ' it is the same code 39. just to...

Replicate space bar browser behaviour using jQuery

Hi, I'm using a bit hacky solution to bottom positon a "facebook chat bar" on my page, requiring the entire page to be inside a "viewport div" with overflow hidden and scrolling. So the entire webpage is inside this div. The problem is that this disables the spacebar - until you click inside it. I gave up my attempt on giving the #view...

jQuery/js dealing with 'double focus' with cursor and event

I'm enabling keyboard navigation for a menu. I'm running into an issue in a particular situation: <ul> <li><a href="" class="link1">link</a></li> <li><a href="" class="link2">link</a></li> <li><a href="" class="link3">link</a></li> </ul> the jQuery: $('ul').keypress(function (eh){ var keyPressed = eh.keyCode; if (...

How do you jump to a particular row in a DataGridView by typing (a la Windows Explorer details view)

I have a .NET Winforms app in C# with a DataGridView that's read-only and populated with some number of rows. I'd like to have functionality similar to Windows Explorer's (and many other applications) details view for example. I'd like the DataGridView to behave such that when it has focus if you start typing, the current row selection ...

OpenGL/Gtkmm game - keyboard moving

Hello, I am programming a game in "OpenGL" and using "Gtkmm" as a window manager. I want to use the keyboard to camera moving (thus, "UP-key" to move forward, "DOWN-key" to move backward, etc...) Some time ago, when I programmed in Java, I used this technique to "move": When the application received for example the "UP-key-press" signal...

What character value does Control + Enter/Return key send?

We have a multi-line control that we are attempting to prevent the Enter/Return key from being used to create a new line. Strangely enough, "AcceptsReturn" as False does not prevent this. So we added the following: Private Sub txtAddr_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAddr.K...

Catch keypress with android

Hello! How can i catch a phone keypress with the android SDK? i've been looking around for hours without finding anything.. For example: In some cases, i want to catch the message when a user presses the "hang up" button on the phone, and then discard the message before it reaches the OS. Is this possible? ...

.NET WinForms: suspend code until mouse move or keyboard press

In .NET WinForms I want to display message in a status bar and suspend the program execution until user moves mouse or presses keyboard. How can I do that? ...

how to write a jquery event handler for dependent auto - complete fields ?

I have a form with 2 text fields which get populated using auto complete. Now when I enter some value in form 1 (through autocomplete ), I want the second form field to fetch the auto complete values using text entered in field1 as one of the parameters. Lets say , text 1 < contains car brand names which are auto populated > text 2 < ...

jQuery: how to filter out non-character keys on keypress event?

I tried searching but unsure of what terms to look for. I'm using jQuery and would like to use the keypress event in a textbox, but prevent all non-printable characters (ie. Enter, ESC, arrow keys, backspace, tab, ctrl, insert, F1-F12, etc) from triggering the event. Is there an easy way to determine if it is printable? ...

jQuery keypress event is giving odd charachters

I have made following code, but whatever I type it will always print some odd char. $(document).keypress(function(event) { var character = String.fromCharCode(event.keyCode); $("body").append(character); event.preventDefault(); return false; }); ...

Sending keystrokes to an application that is not in foreground (ie minimized)

Hello, I have been searching for a working example on how to accomplish this, but no luck so far. This is what I have right now : [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); Process[] processlist = P...

How do I catch a VK_TAB key in my TEdit control and not let it lose the focus?

In my TEdit field I have text in the form <number1>..<number2>. My idea is: When a user enters the control using TAB from another control, number1 gets selected. When my TEdit control has a focus and user presses TAB again, I want the number2 to get selected and number1 to be deselected. And if current caret position is at the place ...

IE e.keyCode - How can I differentiate between ampersand and up-arrow?

I am fighting with a very strange javascript behavior on a jQuery UI widget I'm trying to fix. IE7 (win XP), jQuery 1.2.6 (yes, it's an old version). The widget is a combo-box, which captures keyboard events and has special behaviors for the arrow keys. When I try to type the "&" character into the flexbox input field, I get strange be...

Disable Beep Sound in Vb 6

When I press Ctrl+other keys in a TextBox in VB 6.0, the system plays a beep sound. How can I disable this in VB 6.0? ...