Detect When The Esc Key Is Pressed?
May 20, 2011All i wish to do is have some simple code, which can detect when the esc key is pressed, (if possible can you point out where i need to change to set it for an other key).
View 5 RepliesAll i wish to do is have some simple code, which can detect when the esc key is pressed, (if possible can you point out where i need to change to set it for an other key).
View 5 RepliesI have a webform and i want to detect if F5 button was pressed or if the page was refreshed. I know about postback but it is not what i'm looking for. I have a gridview that loads in a modal popup when a button is clicked and a parameter's value is set for the gridview. When refresh is hit and if the modal popup button was previously clicked the modal popup is visible right after refresh. I want to detect if the page is refreshed to prevent this. any ideas? I thought to try Override but I'm not exactly sure how to use it. I tried Control.ModifierKeys but I don't have access to ModifierKeys.
View 2 Replieshow can I check with getasynckeystate, if ctrl+c was pressed?
getasynckeystate(17) and getasynckeystate(67) doesn't seem to work
even getasynckeystate(17) and getasynckeystate(67) and &H8000 doesn't work too
Is there a way to detect when the Tab key is pressed?
View 8 RepliesI have microsoft force sidewinner joystick, how can i detect its pressed buttons(wheel turns, padels pressed) ?
View 3 Replieshow one would be able to detect what keys are pressed. The problem is i want this done while my application is running in the background. There are alot of examples of doing it when yu are is what you are busy with. My scenario. I have an app process running in the background hidden. The when i press ctrl and t as an example i would like my form displayed.
[Code]...
I have been searching the forums but I keep finding ways to cause events to occur when a key is pressed. I'm trying to get a true/false if the "ctrl" + "L" keys are pressed when the form loads so it know whether to show itself or close
View 15 Replieshow to detect which keyes are pressed on an infrared MCE remote control? I'm a n00b, I've searched google, and can't find anything in VB.
View 1 Repliesim working on a little app for my self, to make my life a little more convenient. I have some media keys on my laptop, and I would like to use them with itunes while it is minimized. I found a app that did it for me a long time ago, but cant seem to find it now. But I would like to try my hand at my own, and I've managed to do so, but, my app has to be in focus for it to work. is there any way to still detect when these media keys are pressed while my app is out of focus?
View 9 RepliesI am using the media player control in my VB2010 project and hit a problem. I want to detect when a user has pressed the "next " button on the media player console.I can use the following code to detect the pause, play, fast forward, etc but I do not see anything that will detect when the "next" button is pressed.
[Code]...
How can I set a button, so that when it is pressed, it stays in the pressed down graphic state. Then when pressed again it returns to the normal not-pressed visual.Make a button stay like this until pressed again: url....
View 3 RepliesI have a TextBox and set the MiltiLine property to true and AcceptsTab property to false.When the TextBox has focus and i press Tab it works fine and the next control get the focus, but when i press Ctrl+Tab it works as if AcceptsTab property is set to true and makes a tab character into the TextBox.The reason i press Ctrl+Tab.. when switching between forms in my MDI application.Now how to make a Ctrl+Tab when pressed works like Tab when pressed in a MultiLine TextBox?
View 1 RepliesPrivate Sub ContextMenuStrip_ForDisplay_Opening(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip_ForDisplay.Opening
If Utility.IsKeyDown(Keys.S) OrElse Utility.IsKeyDown(Keys.V) Then
[Code]....
I do the above to cancel the menu if S or V is pressed.
I'd like to cancel if ANY key is pressed.
i have a pocket pc that have some special keys and i need detect when a key is pressed in my program. how can i detect the keys that is pressed? i have tested in a textbox change function the box detect all keys except that special keys there is some api to look for alk keys thats is pressed in pocket pc?
View 3 RepliesI need to check if the SHIFT or CTRL keys are being pressed in my VB.net application? (get a boolean)
View 3 RepliesHow would I check if a key is currently being pressed?
Also how would I detect if a key is pressed without using the KeyDown event. The reason I am not using the keydown event is when the user holds down a key it calls the event, waits a second than keeps calling it. I do not want the wait period if a user is holding down a key.
How do I find out if any key is pressed during a certain time?i have a timer to the "certain time" is no problem.But how do I find if any key is pressed?
View 14 RepliesI'm looking for a way to find when no key is pressed. I'm creating a game and I have an animated characted. When you press the movement keys he moves and is animated. I need to know when no keys are being pressed so I can tell the animation to stop.
View 1 RepliesThis may sound like a dumb question but I need to know. I know you can tell which keys are pressed on the keyboard but I like to know if I can do something.Ok, heres what I am trying to do. A user is in another program that is max on the screen. He has to press Print Screen to take a screenshot, but he got to min the screen he is in to paste the screenshot into paint. This causes slow loads on maxing that screen and sometimes crashs of the program. I already got the code done to check when the program is running and to capture the screenshot and save it. What I to do now is, find out while in the other program with my program running in the background, if the user has pushed the Print Screen button.
View 2 RepliesHow do i get if a Key is pressed on the whole form. Like A? or Ctrl + A
View 5 Replies'pressing F1 key on main form. I dont know how to trap whether user pressed F1 key or not
Private Sub frmMain_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
Dim KeyAscii As Long = Asc(e.KeyChar)
[code]....
How to make a key being pressed do something?If 'w' is pressed, then...
View 2 RepliesSo i just wrote this awesome program, but now it doesn't run when I try to! When I press F5, or press the run button, this error happens:
View 6 RepliesI want to make it so that if the key 'shift' is pressed it does something. I have this VB.Net
If Keys.Shift = 1 then
MessageBox.Show("pressed shift")
How can I check if a perticular button was pressed first?
I need something along the lines of:
if btnNewGame.wasPressedFirst then
do this
else
do this
How do I check if Control + Z is being pressed?
I managed to check for when one key is being pressed, but apparently I can't check for two at the same time.
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
What is the keyValue I need for checking for the DELETE key using e.keyValue?
Im doing a small project in visual basic which involves lighting up leds through the parallel port and turning them on and of. each led is controlled by a checkbox on my form and they only come on when the checkbox is checked.
what code do i need to use to have the checkbox checked when a key is pressed but when the key is released the checkbox is unchecked i have already tried keydown which will check the box when a key is pressed but will not uncheck it when the key is released
If e.KeyValue = Keys.A Then
CheckPin1.CheckState = CheckState.Checked
ElseIf e.KeyValue <> Keys.A Then
CheckPin1.CheckState = CheckState.Unchecked
End If
I am making a Tetris program and I have a 2d array 10 by 20 for the grid.I want the Tetris blocks I have created to move down one block every second unless the user presses "a" or "d" (to move left or right) then the block should move left or right whilst moving down.The problem is that I have created a loop for it to delay a bit but then it waits for the user to press a key until it continues the program. So the block will stop moving down and just stay where it is until they press something.I have been told that you can do this in C with something like if keyboardhit or kybd() or something then it will read the key but otherwise it will just skip that bit and loop round. So how can I do this in VB?
View 2 RepliesHow can i count keys pressed within ex. 1 min? Or how do i count a spesific key?
View 1 Replies