keydown

Silverlight keydown event for games

I'm trying to use the key down event in silverlight for a game I'm working on. The problem I'm having is that silverlight treats keydown like windows does. For example if you hold down the left arrow key the keydown event triggers once, then pauses for a short while before triggering repeatedly. Obviously in a game this won't do since a...

Disable keydown during animation

Hi, I'm using the following code to enable the user to show or hide a photo description (#photoinfo) and a menu (.slidetable) using the up and down arrow keys. If one of these two divs is already open, pressing the opposite arrow closes that div before opening the other. $(document).unbind('keypress'); $(document).keydown(function(even...

Get the char on Control.KeyDown?

Hi When handling Control.OnKeyPress event, there is a KeyPressEventArgs that contains a KeyChar. For usability reasons I need exactly the same KeyChar but when handling OnKeyDown event. The KeyEventArgs does not contains any char related data. I mean, if press the A key with or without Shift its not affecting the KeyCode, KeyData or K...

jQuery key code for command key

I have read http://stackoverflow.com/questions/302122/jquery-event-keypress-which-key-was-pressed and http://stackoverflow.com/questions/2445613/how-can-i-check-if-key-is-pressed-during-click-event-with-jquery However my question is if you can get the same key event for all browsers? Currently I know that Firefox gives the command butto...

Changing animation on a movieclip on a key press is failing.

So far, I have the following Actionscript 2.0 code - I'm trying to make the animation change on a key press then loop to simulate running. But it sticks on the gotoAndPlay(9) trigger, regardless of what frame the animation is on. onClipEvent(keyDown) { if (Key.isDown(Key.RIGHT)) { this._x += 5; ...

jQuery: How to catch keydown + mouse click event?

I have a div element. I need to catch a mouse click on this div while alt-key (keyCode = 17) is pressed. Here is what i've got to catch key press: // Html <div id="targetDiv">I want to put a ding in the universe.</div> // Java-script $(document).ready(function(){ $(window).bind('keydown', function(event){ if ( 17 == eve...

KeyDown not fired in SketchFlow

I'm trying to add a KeyDown event handler to the LayoutRoot of a view in a Silverlight SketchFlow project, but it doesn't seem to fire. The event fires if I change the event type to MouseLeftButton, but I want to demonstrate this using a keyboard-shortcut. Does anyone know how to accomplish both? ...

How to trigger key combo with jQuery

Hi all, I have coded some stuff: http://fincha.com/kunden/schmitt/ I zoom in with .css("zoom") but I need the buttons to simulate CTRL + or CTRL - This code isn't working for me: e = jQuery.Event("keydown"); e.which = 50; $("input").trigger(e); Please help! EDIT I just wont to zoomin and zoomout the hole page ...

How do you use jquery .live() with keystrokes?

I am building a photography portfolio for a client and decided to make it a little bit more interactive. I got rid of all buttons on the site and had the user interact with the site using key strokes. My original code used: $(document).bind('keydown', function( e ) { but this unfortunately would not allow the user to interact with the...

unbinding keydown jquery

I have created a method where you press the left and right keys and it goes from either the next or the previous page. the problem is that once you change it to another album the keypress methods are still bound to the previous album so you press the right key it will change the image in both the current and previous albums. I have tri...

How to forbid backspace key in WPF

Hi all How can I forbid the Backspace-Key as easy as possible in a WPF-Application? The KeyDown-Event don't catch at the DEL and the Backspace-Key. Thank you! ...

C++ WINAPI: How to use SendMessage/PostMessage WM_KEYDOWN lparam

As an amateur to anything lower than VB/VBS (C++ WINAPI is a nightmare for someone of my experience) I have no idea how to go about constructing the long lParam for a simple KEYDOWN message in C++ and have probably spent more time looking for a decent explanation than is worth, would someone be able to describe exactly how to go about th...