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
3
votes
2 answers

Clipboard updated event fired multiple times

I am trying to make a global multi value Clipboard. I have used a stack to store the values. I am using WinProc() to capture the global Copy operation where I push the value on stack. Similarly I am using a windows keyboard hook to capture the…
ResVict
  • 312
  • 2
  • 12
3
votes
1 answer

Is it possible to poll GetKeyboardState() as a replacement for a global keyboard hook?

Is it possible to poll GetKeyboardState() as a replacement for a global keyboard hook?
Alex
  • 31
  • 1
3
votes
2 answers

How to exit a program by pressing the escape button?

I spent two hours for the past three days researching and cannot figure this out. This is a simple program that clicks the left mouse button every 2.5 Seconds 50 times and then the program ends. But sometimes I want to end the program sooner by…
user3144079
  • 159
  • 3
  • 12
3
votes
1 answer

Windows Hooks with golang

I'm writing an application that will make use of the Win32 API WH_KEYBOARD hook so that it can be activated (i.e., displayed in the foreground) without having focus. The callback, naturally, is a function pointer (of type HOOKPROC). A lot of the…
Hut8
  • 6,080
  • 4
  • 42
  • 59
3
votes
1 answer

SetWindowsHookEx + WH_CBT doesn't work? Or at least not the way I think it should?

I have diagnostic program that uses SetWindowsHookEx and WH_KEYBOARD_LL to scan codes system-wide I'd like to extend it to monitor window focus changes, which is a possibility using SetWindowsHookEx and the computer-based training CBT hook…
Ted Middleton
  • 6,859
  • 10
  • 51
  • 71
3
votes
1 answer

How to get keyboard input while running in vmware virtual machine?

I'm logged into a virtual machine using vmware workstation 6.5-7.0.1 or vmware player 3.0.0. I'm working inside the virtual machine. Then I press a key (for example the Delete-Key, but it should work with every key) inside the virtual machine. I…
raisyn
  • 4,514
  • 9
  • 36
  • 55
3
votes
4 answers

Ending a program when a certain key on the keyboard is pressed

I want to be able to end my program when a certain key is pressed (For this example we will say when k is pressed). I know that this could be done by using JFrame and KeyListener but want this my listener to run in the background. My program…
sexp1stol
  • 445
  • 4
  • 17
3
votes
6 answers

Global Keyboard hook not working

I have created a global Keyboard hook. Hook is created in a DLL. #pragma comment(linker, "/SECTION:.SHARED,RWS") #pragma data_seg(".SHARED") static HHOOK hkb=NULL; static CMyFile *pLF; #pragma data_seg() HINSTANCE hins = NULL; extern "C" LRESULT …
anand
  • 11,071
  • 28
  • 101
  • 159
3
votes
1 answer

Using a low-level keyboard hook to change keyboard characters

I'm creating a custom keyboard layout. As the beginning step, I want to have the user press a key, have my keyboard hook intercept it, and output a different key of my choosing. I found this keyboard hook code, which I'm trying to slightly modify…
ck_
  • 3,719
  • 10
  • 49
  • 76
3
votes
1 answer

Does ToUnicode call ToUnicodeEx? And what does ToUnicodeEx change on the kernel space thread?

ToUnicodeEx: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646322(v=vs.85).aspx ToUnicode: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646320(v=vs.85).aspx It seems that the only difference between the two is that…
Chris
  • 753
  • 2
  • 8
  • 22
3
votes
3 answers

SetWindowsHookEx does not react on media keys

I want to capture user keyboard input to react well on keyboard media keys: play/pause, next and previous in particular. I tried to use SetWindowsHookEx with low-level WH_KEYBOARD_LL param to ensure I can get maximum responsibility from this WINAPI…
Tommi
  • 3,199
  • 1
  • 24
  • 38
3
votes
1 answer

"CallbackOnCollectedDelegate was detected" while trying to hook keyboard

I'm using this code GlobalKeyboardHook.cs to hook keyboard. I've altered everything specified as per instructions in this post. Now My code looks like this: using System; using System.Collections.Generic; using System.Text; using…
Dreamist
  • 123
  • 8
3
votes
1 answer

How do I determine the host application of a pressed key using a global hook?

I'm interested in keyboard listening in the context of a particular application, like Microsoft Word. Googling showed that the only way to solve this problem is to use a global keyboard hook. A global keyboard hook listens to all key press events in…
user2104560
3
votes
2 answers

C# Mono - Low Level Keyboard Hook

I'm using code that I found on the CodeProject.com for a low-level keyboard hook. The only problem is it uses external DLL calls that don't work in mono. I was wondering if anyone knew of a way to accomplish the same thing as that code, but will…
Joel
  • 16,474
  • 17
  • 72
  • 93
3
votes
5 answers

How do I trap windows key, alt+tab, ctrl+alt+delete in C#?

How do I trap Windows key, Alt+Tab, and Ctrl+Alt+Delete in a Windows application using C#?
Suriyan Suresh
  • 2,964
  • 14
  • 51
  • 80