keyboard-hook

Global keyboard hook with C++

爷,独闯天下 提交于 2019-12-22 09:06:44
问题 I've already saw many tutorials and articles about hooking, yet I don't quite understand it. Mainly because every single example uses different solution. I know I will have to implement something that will keep the hook alive. Usually it's some kind of while cycle. Q1: If this loop was in some class with callbacks, will it prevent the thread from executing them? I know it will take a while, but I would highly appreciate some well explained example of global keyboard hook. Or simply link me to

Low level keyboard hook & keystrokes from rawinput

╄→гoц情女王★ 提交于 2019-12-21 02:27:34
问题 Currently, I'm making a program that intercept keystrokes from a specific keyboard (filtered using its HID). So to know which keystrokes have been sent by a specific device, I used the RawInput technic, inspired by this great tutorial: http://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard Now, it works great: I can get a keystroke and know which keyboard have generated it. The difficult part of my project is to intercept and block keystrokes from this

Override default INT 9h

我的梦境 提交于 2019-12-20 07:38:36
问题 I'm trying to override the default interruption when a key is pressed. Here is my code : I don't understand why it doesn't work, it works with others INT numbers (43h for example) mov al,9h mov ah,25h mov bx,seg int9h mov ds,bx mov dx,offset int9h int 21h (Where int9h is a label in my code) Does anyone know how to hook the interruption when a key is pressed ? Thanks ! EDIT: mov ax,2509h mov dx,offset int9h int 21h int9h PROC ;do some stuff IRET int9h ENDP 回答1: I'll try and answer this again -

Monitoring keyboard activity in C# while my application is in the background

馋奶兔 提交于 2019-12-18 19:06:48
问题 First of all I need to make it clear that I have no interest in keylogging. I need a way to monitor keyboard activity at the most basic level while my application is in the background. I don't need to know which keys, I don't need to save any data, I don't need or plan to hide my application at all, all I need is to know when keys are pressed and invoke a method. I'm looking for the simplest way to do this possible, I know a reasonable amount of C# but nothing too complex as most of my

ToAscii/ToUnicode in a keyboard hook destroys dead keys

五迷三道 提交于 2019-12-17 23:20:15
问题 It seems that if you call ToAscii() or ToUnicode() while in a global WH_KEYBOARD_LL hook, and a dead-key is pressed, it will be 'destroyed'. For example, say you've configured your input language in Windows as Spanish, and you want to type an accented letter á in a program. Normally, you'd press the single-quote key (the dead key), then the letter "a", and then on the screen an accented á would be displayed, as expected. But this doesn't work if you call ToAscii() or ToUnicode() in a low

VB.NET Detecting Keypress While Minimized

坚强是说给别人听的谎言 提交于 2019-12-17 21:37:19
问题 I want to be able to detect when the user presses F10 or Ctrl+F10 outside of my program, and upon receiving the key press, it will send text to whatever they currently have selected (e.g. a text box). How can this be accomplished in the simplest way? 回答1: Use RegisterHotkey and not a keyboard hook to get a global hotkey. See one of my older answers on almost the same question: listen for a key when the application is not focused 回答2: The first problem here is that the F10 key is already a

JNA Keyboard Hook in Windows

ε祈祈猫儿з 提交于 2019-12-17 02:50:07
问题 I have put together a JNA code for installing keyboard hook in Windows (using the JNA examples). The code compiles and everything, and I get the hook installed (I get handle to the hook successfully), also I can uninstall the hook successfully. However, the callback never get called when I press any key on the keyboard. Here is my code (most of it are type definitions got from the JNA examples, go to the "main" directly for my part) import com.sun.jna.IntegerType; import com.sun.jna.Pointer;

How to tell the difference between a user-tapped keyboard event and a generated one?

随声附和 提交于 2019-12-12 07:52:27
问题 I've installed a keyboard hook: CGEventRef myCGEventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) { Basically I want to take the user's keyboard taps, eat the input, and post my own input instead. So if he taps "g" I might want to post "foo" to the textfield. I'm writing to the textfield with CGEventPost and CGEventSetUnicodeString as found here: http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg23343.html The problem is that each of my

Global hook using WH_GETMESSAGE and WH_KEYBOARD

为君一笑 提交于 2019-12-12 01:58:52
问题 I try to make the global hook, in order to catch the number from keyboard, change it, and pass it. So for example: if I type "0" in google, the software will change it, and the "1" is inserted instead. In order to learn, how the hooks works, I used WH_KEYBOARD in order to get all keys inserted into my pc. And it worked. However, now I would like to change the key globally, and in order to do that I use WH_GETMESSAGE. And in this case, hook isn't applied globally, but locally instead(in test

Binding key combinations to your application

依然范特西╮ 提交于 2019-12-11 15:43:36
问题 How can I bind a key combination to my vb.net application? I know it has SOMETHING to do with the registry, but I have no earthly idea what or how to go about doing this. I want the user to be able to hit those keys when the app is open and have it execute my function, but not while the app is closed. Thanks for the help! 回答1: If you are using a dialog, then you can put '&' into the text for some controls (buttons, checkboxes, radio buttons, etc) and this will cause Alt plus the next