Questions tagged [keyboard-hook]

The term keyboard hook covers a range of techniques used to alter or augment the behavior or intercepting keyboard event messages before they reach an application.

The term keyboard hook covers a range of techniques used to alter or augment the behavior or intercepting keyboard event messages before they reach an application.

313 questions
5
votes
1 answer

C# - How to send small letters with SHIFT key using SendKeys.Send?

I am using this keyboard hook for my project. I am unable to send small letters using SendKeys.Send() with SHIFT modifier key pressed. My app needs (for example) if the user presses K button "a" should be sent and if he presses SHIFT+K, "b" should…
ePandit
  • 2,905
  • 2
  • 24
  • 15
5
votes
3 answers

Bypass refresh behavior of Firefox

How do you capture refresh button or event of Firefox browser using Javascript and imitate the behavior of IE when refreshing forms? Firefox refills the forms which destroys my ajax UI.
Aivan Monceller
  • 4,636
  • 10
  • 42
  • 69
5
votes
2 answers

How do you implement global keyboard hooks in Mac OS X?

I know this can be done for Windows and that XGrabKey can be used for X11, but what about Mac OS X? I want create a class that allows setting shortcut keys that can be invoked even when the application windows are inactive.
Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
5
votes
2 answers

Anything wrong with spamming GC.KeepAlive(KeyboardHookPointer)?

GC.KeepAlive() References the specified object, which makes it ineligible for garbage collection from the start of the current routine to the point where this method is called. Not really sure about what GC.KeepAlive does other than simply store a…
Alex
  • 51
  • 2
5
votes
1 answer

Using KBDLLHOOKSTRUCT to determine first key press

I'm using a low-level keyboard hook on windows. It works like a charme, despite of the fact that I'm currently unable to tell whether the key was initially pressed or pressed again. The documentation (+here) says, that bit 7 holds the transition…
The Wavelength
  • 2,836
  • 2
  • 25
  • 44
5
votes
2 answers

key capture using global hotkey in C#

I have a application that runs in the background like i may keep my app in the system tray.If it remains on system tray my app will do it's job. Whenever a user press F10 or F9 some works will be done. i tried this: public partial class Form1 :…
ImonBayazid
  • 1,066
  • 3
  • 16
  • 41
5
votes
4 answers

Capturing a key without focusing the window

I have a application that always checks if a key like F12 is pressed. It doesn't need to have in focus of my main window of my app. I tried this code: public int a = 1; // DLL libraries used to manage hotkeys [DllImport("user32.dll")] …
user2173270
5
votes
1 answer

System wide keyboard hook on Vista and later

I have a system-wide keyboard hook DLL that I have created that has been working successfully for years in Windows XP. However, it appears that in certain later versions of Windows (Vista Home Premium, and Windows 7, to name a couple), the hook…
kes
  • 5,983
  • 8
  • 41
  • 69
5
votes
1 answer

Another global hook affects to my global hook

I wrote a global keyboard hook program in C# .NET act like a keylog, it writes results to a file. But i used another program, which supports for type Vietnamese language in same computer- it also uses global hook to fix set keyboards to Vietnamese…
5
votes
2 answers

How to determine the current input language?

I am designing an on screen keyboard, I need to determine which language been set by the user and which language he is using now in the other threads, i.e. I need to know the language selected in the taskbar language switcher: P.S. current culture…
Abdallah Nasir
  • 607
  • 6
  • 33
5
votes
1 answer

Error when using SetWindowsHookEx in Windows XP, but not in Windows 7

I have develop a application that use a global keybord/mouse hook. It works perfect in Windows 7, but not in Windows XP. When I call SetWindowsHookEx in Windows XP, I get error code 1428 int MouseLowLevel = 14 int code =…
magol
  • 6,135
  • 17
  • 65
  • 120
4
votes
0 answers

How to check if SetWindowsHookEx hook is still working? (Win7 bug workaround)

I am writing a program in MS VisualC++. I set a keyboard hook by hHook = SetWindowsHookEx(13,MyProc,GetModuleHandle(NULL),0);. There is a bug in Win7, which I can reproduce, that disables my hook. When this bug happens, hHook is still TRUE, but…
4
votes
4 answers

Keyboard hook changes the behavior of keys

I'm creating a program that installs a keyboard hook to capture all keys and display some text related to them. However, I've hit upon a snag, and that is some keys change behavior when the hook is installed. I'll see about posting a small, but…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
4
votes
3 answers

Global keyboard hook with C++

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…
Mikulas Dite
  • 7,790
  • 9
  • 59
  • 99
4
votes
2 answers

Global Keyboard Input Go

Does Go provide a way to listen to global keyboard inputs? Essentially like a keylogger (however that's not my purpose) where it captures input if the focus is outside its own context. Ideally it would be cross platform, but if not Windows only…
bclymer
  • 6,679
  • 2
  • 27
  • 36
1 2
3
20 21