I'm trying to make a prank program that registers all of the letter keys on the keyboard and then will make random message boxes pop-up when you press certain ones, or just re-arrange the letters.But before adding any pranks, I'm trying to just get all of the hotkeys to work like a normal keyboard because when you register a key to be a hotkey, it no longer works for anything else. So registering "e" in the program will cause "e" to do nothing when your in notepad or something.
So far I've gotten pretty much everything to work except for this weird Shift bug. Whenever I press Shift and then a letter, the Sendkeys will correctly send the uppercase key, however as soon as I release shift and press a key without it, it still keeps the uppercase for one more letter.So if I press Shift + E then "E" will be successfully sent to Notepad, but then if I just press "b", "B" will be sent instead, but then after that first error it will successfully send lowercase again.
I was using wordlabel to store the letters so as to see if the shift uppercase problem was something in my coding, but actually when I press Shift + A and then just press a, it will do Aa in the label but AA in a program with the focus, like Notepad. So I don't know if this is a problem with Sendkeys or what but does anyone know of a solution?
1)I have saved some data in a text file, now I want to assign it a hotkey, so that when a user presses the hotkey (assigned by the user) that file data should be displayed in a text editor or email etc.
2) should I save the text file and hotkeys into database? if yes then how? I am totally new to program.
In my keydown event handler, when Keys.Numpad4 is pressed with Shift, I get the same keycode code as for Keys.Right. Is this by design? How can I distinguish between the two?
I seem to have a bit of a problem with the ICShartEditor text editor. It works fine for me in a Windows Forms app, except that if I have a button (or any other control) on the same form that defines a hotkey (like ALT-S for a Save button), then whenever I try to type 'S' in the text editor (or whatever the hotkey might be), then it triggers the hotkey rather than adding the character to the text.What appears to be happening under the hood is that all the ProcessMnemonic() methods for all controls of the form run, so those methods kick in and handle the keypress, which I would think should only happen if a key like the ALT-key is pressed.
I'm writing a program where there's a toolbar at the top, and to hide the toolbar you click "Hide Toolbar", but I need to create a hotkey to make it come back.
I have a code to detect Flashdrive USB insert. It works, but how can I detect a disconnect? You can google for any code to detect usb flashdrive insert, it's easy, but how disconnect.I needed to have a hotkey for a button function. I made an insivible menustrip with the code with the hotkey. How can I make the hotkey work EVEN if I alt tab out of the program (As long as it runs background)?
I'm trying to get hotkeys to work in my application (to make it visable if its minimized). I got it to work except that they only work once... the second time you try it does nothing.
here is the code i was using
Public Enum HotKeyModifiers As Integer MOD_ALT = &H1 MOD_CONTROL = &H2
Now my question is, is it possible to use Hotkeys and ScreenCapture in a Fullscreen game?If so, how?What im acutaly trying to do is a program to take a screenshot ingame (for some reason, this game doesnt have an option to take screenshots ingame.. Bad Company 2)
I have been trying over the past few days to make a program sit open on the computer, waiting for a key press (which will be the hotkey). When the key is pressed, it will execute a peice of code and minimize itself. Im really sorry if this is too simple but im stumped over this one. I have searched google alot but no luck
So: I need to know how I can have the program 'monitoring' or 'looking for' a certain key press while it is doing something to tell it to stop, bearing in mind when the program actually starts it will minimise and stay minimised untill this hotkey is pressed that makes it maximise itself and stop the program.
I've written a simple WAV player in VB 2010 - a Windows Form App with no menus. I'm trying to create a hotkey, like CTRL-D that would make a text box visible. Typing the correct password in the box will expand the form and show some Administrative functions. I'm having issues creating the hotkey with more than one key.I've got the following code, but it does not work. I do have KeyPreview set to True.
Private Sub _KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Control And e.KeyCode = Keys.D Then txtPWD.Visible = True
I've also tried
If e.Keycode = Keys.ControlKey & e.KeyCode = Keys.D
and many other variations including changing to ALT and SHIFT but nothing seems to work. If I remove one of the Keys, it works just fine.
If CheckBox_StartHotkey.Checked = True Then If Not ComboBox_StartHotkey.Text = Nothing Then Dim StartHotKey As Boolean StartHotKey = GetAsyncKeyState(ComboBox_StartHotkey.Text) If StartHotKey = True Then StartActions()
[Code]...
I am trying to input the function key that a user has selected from a ComboBox (containing the function keys F1~F12 as options) into the GetAsyncKeyState(). However, since the ComboBox_StartHotkey.Text is a string, it cannot be converted into Long data type needed for the GetAsyncKeyState() function. I have tried Conversion and Parse Methods but what I try doesn't seem to work. Anyone know how to effectively convert a String (such as F6) into a Long data type for using in the GetAsyncKeyState() function in this case?
I used the tried to use the ItemData property to hold the Key Code representing the Function Key.
Can VB.NET Form keyDown event determine whether left or right shift (alt, control) key was pressed? I always receive the same keycode (16) for both left and shift key!
Using the code from this thread, I have been able to successfully register hotkeys for myself. I am having trouble though, I am trying to register a hotkey with the Control Constant; it doesn't seem to be working. I need to register Control + 1 (MOD_CTRL, Keys.D1). I know how to do this, yet I can't seem to get the MOD_CTRL constant to work. I've found that the constant for Control is &H11 but as I said previously, this does not seem to fire for either the left control or right control keys.
Currently I can not get my hotkeys to start and stop my program.Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer and
I have a small app with one form (form1) which is supposed to be hidden until a hot key combo is pressed. I have read and taken sample code from: [URL]. I do have a keyboard class that hooks keyboard input, (I have my reasons) but it's odd that it will recognise the first hotkey and fire the event, but none after that? The problem is, I can make the form show, but not hide again. It will only recognise one shortcut, one time. How do I make it respond to another hotkey combo? Is the handle changing? Even with focus, the enabled form is not hiding again.
I was wondering on how i can make multiple global hotkeys and have them show message boxes just so i can learn and expand from there. Like have one be ctrl + alt + F1 and the other be ctrl + alt + F2.
Below is the section I'm having trouble with at the moment:
Friend Sub glbHooks_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles glbHooks.KeyPress newStr = newStr & LCase(e.KeyChar)
[Code]....
Neither of these worked, though the 2nd one would clean up my code a bit. Unfortunately I'm getting an "Expression expected" error on that "newStr = If..." line. I know there's supposed to be a "Then" somewhere along it but I don't know where it's supposed to be and the poster hasn't gotten back to me on that yet.
I'm working on a project that contains hotkeys, but I don't wish to have global hotkeys. At the moment, I'm using KeyDown and e.KeyCode for hotkeys. I've created test projects where these worked perfectly fine, but on my main project, they don't register.
I have been able to toggle CAPS, NUM AND SCROLL lock using the method below but using the code below that although no error occours when I click the button nothing happens?The code which works for caps, num and scroll