Questions tagged [keyhook]

Changing listening or reacting to events related to specific keys of the keyboard or other devices.

A key hook is a feature that allows to replace or extend the standard behavior of specific keys of the keyboard or other devices, in a systematic way.

The hook may work at a low level, by replacing some system routines at operating system level or in the keyboard driver. It is different from a simple event listener, in that the hooks behavior is not specific for a software feature, but is general to the whole application or event to the whole system.

Related tags

  • Use tag for hooking other event drivers than those of the keyboard.

See also

34 questions
1
vote
0 answers

Simple Keyboard Hook to Start/Stop Timer in VB.Net 2010

I making a program that needs to be able to respond to the key press of Ctrl + ' (that's control + apostrophe) even when the program does not have focus. The Ctrl + ' will be used to start and stop a timer. The code would be something like (just…
user2348797
  • 373
  • 4
  • 9
  • 22
1
vote
3 answers

Low-level Keyhook

I would like to run a low-level keyhook on a seperate thread in C# to detect for certain hotkeys. How would I do this?
cam
  • 8,725
  • 18
  • 57
  • 81
0
votes
2 answers

Why does my low level windows key hook stop working?

This is a continuation of my original question Why is D3D10SDKLayers.dll loaded during my DX11 game? I am creating a DX11 game and am using a low-level windows key hook to capture Alt+Enter so that I can toggle fullscreen using my own methods…
Darkhydro
  • 1,992
  • 4
  • 24
  • 43
0
votes
0 answers

keyhook combinations with Alt Gr not working

I tried to make keyboard remapping using keyboard hook. It works fine with Shift, but it doesn't with Alt Gr - it's like it can't detect it pushed down while having multiple keys down or something. I was debbuging and it seems like clicked alone Alt…
Werinl
  • 1
  • 2
0
votes
2 answers

Windows Low-Level keyboard hook, allow (Win + H) not other Win + hotkeys

We have a kiosk app where we would like to allow use of the Win + H hotkey to bring up Voice Typing, but still filter out other Win + ... hotkeys and the Win key by itself. The hook is set with SetWindowsHookEx(WH_KEYBOARD_LL, callback, hInstance,…
Dave S
  • 1,427
  • 1
  • 16
  • 18
0
votes
1 answer

C# Global hook Keyboard, Winform - .NET 6.0

I have a question about a problem I haven't been able to solve in the past couple hours. So basically I want to make a C# WinForm app in .NET 6, and I need the app to respond to the ctrl key being pressed (It would simulate what a click of a certain…
AGlasencnik
  • 139
  • 1
  • 12
0
votes
1 answer

Java / Transform key from keyboard or mouse to another key

I have a swing Java application (A) that launches another application (B) using Runtime.getRuntime().exec() when a certain button is pressed. Is it possible to set a certain Key Hook so that when the application (B) is open and active, it changes…
Neo
  • 69
  • 7
0
votes
1 answer

How to stop further processing global hotkeys in C#

I am trying to create a C# application that will react on a global hotkey; ALT+H and then when I release the ALT key. This actually does work very well but my problem is that when my application has done whatever it should do with the hotkey then it…
Beauvais
  • 2,149
  • 4
  • 28
  • 63
0
votes
1 answer

How to have a hook and have a timer running at the same time?

I am trying to write a macro program in C and I have managed to get the keys with the following code: #include #include HHOOK _hook; KBDLLHOOKSTRUCT kbdStruct; LRESULT __stdcall HookCallback(int nCode, WPARAM wParam, LPARAM…
Tigris
  • 1
  • 2
0
votes
1 answer

Can't paste string using (SendKeys.Send)

I am trying to create an application that allows me to run an event even though the application isn't in focus. When I trigger the event using [ctrl + alt + V], it will pick a random string in an array and paste it into the currently selected…
Elias Wick
  • 483
  • 6
  • 21
0
votes
1 answer

KeyHook used to detect multiple keys pressed at the same time

Hi i have created a program to monitor the keyboard and if CTRL+Shift+R are pushed the the program must start recording the keys and write them to a text file. I have got the second part(monitoring keys and writing to text file) working perfectly…
0
votes
1 answer

Powershell / C# keyhook script NullReferenceException externally

I'm trying to use a powershell script (using C#) to listen to key strokes. It works a short time before erroring out. What's interesting is after I added some console writes, it seems the error is occurring external to my code. Here's the powreshell…
junvar
  • 11,151
  • 2
  • 30
  • 46
0
votes
1 answer

How to get the "ctrl c" or mouse copy event in a Powerpoint 2013 Addin (developed in C#)?

Code below is not trapping character type in MS Powerpoint, It does just outside of Powerpoint and how can I catch the "control copy" or "right mouse click copy" inside this code? Code below is not trapping character type in MS Powerpoint, It does…
0
votes
2 answers

Vb.net Capture Ctrl+C

I want to capture when someone uses CtrlC even when off focus. im using Visual Basic 2010.
Joseph
  • 255
  • 1
  • 6
  • 11
0
votes
2 answers

Uninstalling keyboard hook when the user leaves the application

I am trying to detect when a user alt tabs out of my window. I have tried several messages (WM_ACTIVATE, WM_KILLFOCUS, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_CANCELMODE, and WM_SYSCOMMAND checking for SC_MINIMIZE). But the same problem still occurs. The…
Philip Bennefall
  • 1,477
  • 5
  • 20
  • 33