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

SetWindowsHookEx WH_KEYBOARD_LL not responding on right shift

I try to use the Windows API in c++ and SetWindowsHookEx WH_KEYBOARD_LL does not seem to get events from the right Shift key (the Shift key at the right side of a qwerty keyboard, below the Enter key). It does work with the left Shift key. How do I…
user10056
  • 63
  • 4
  • 12
4
votes
2 answers

How to listen keyboard in background and fire keystrokes on demand?

I want to make a program in vb.NET 2008 which will listen keyboard in background, i.e. even though the application is minimized (globally). If a specific key is been pressed by user, it should keep firing 2 other keys at regular given time intervals…
3
votes
1 answer

global keyboard hooks in c

i want to write a global keyboard hook to disallow task switching.When i googled i found a whole lot of codes in c#,cpp (and delphi), but i need some basic concepts about hooking (would be the best if examples are in C).So, kindly suggest the…
buch11
  • 872
  • 3
  • 13
  • 29
3
votes
2 answers

Disabling keys using windows hooks

I am trying to completely disable the letter 'a' on the keyboard using lowlevel keyboard hook. The problem is that when i return 0 from keyboardproc the key is not disabled but when i return 1 it gets disabled. I thought that returning from…
Neal
  • 453
  • 2
  • 8
  • 19
3
votes
1 answer

Using CGEventSetIntegerValueField to edit a keyboard event gives error

So, I asked another question here: How to tell the difference between a user-tapped keyboard event and a generated one? One of the answers that came up was to use the "mouse pressure" field (unlikely to be used for a keyboard event) to mark the…
ck_
  • 3,719
  • 10
  • 49
  • 76
3
votes
1 answer

Python Keyboard library not suppressing keystrokes on Linux

I am making a script that remaps a single key (right-ctrl) into alt+tab using the Python library known as keyboard. This was easy to do with Autohotkey on windows, however, this doesn't seem to be possible on Linux. After all in the keyboard…
255.tar.xz
  • 700
  • 7
  • 23
3
votes
1 answer

ToUnicode doesn't return correct characters

I tried to call the ToUnicode inside a low level keyboard hook and print the character(s) it returned. However, it seems that the function doesn't take into account whether special keys, such as shift or caps lock were pressed, so the output is the…
Jason
  • 33
  • 1
  • 6
3
votes
2 answers

How to unhook keyboard-hook using c# to develop a keystroke changing software

I am trying to develop a software which will take a keyboard input, consume the input and return some other character inexchange of the typed input. For example, if i type: "abcd" and define exchange rule as any russian alphabet then i would expect…
seoul
  • 864
  • 1
  • 12
  • 32
3
votes
3 answers

What's the best way to have a non-blocked thread permanently doing "nothing"?

I'm using low level hooks. I have made this class: class Kayz { static int VKEY; static void (*funcDown)(); static void (*funcUp)(); static HHOOK TheHook; static KBDLLHOOKSTRUCT TheHookStruct; static LRESULT _stdcall…
TrisT
  • 639
  • 6
  • 19
3
votes
1 answer

Detect global Keyboard Hook in C3

It's incredibly easy to write Key-loggers in many languages. It makes me a little nervous because these small, unknown viruses won't get detected by most(read: all) antivirus'. I'm curious how to detect if some process grabbing these keys. I want to…
Xnu17
  • 31
  • 1
3
votes
1 answer

C# Checking if more than one key is pressed (Global Keyboard Hook )

I'm making a C# form app that runs in the background and checking if you pressed CTRL + A + S. So I was checking forums on the internet and I already setup that the app runs in the background and now I'am trying to setup keyboard hook. I found a…
R.Faladore
  • 33
  • 1
  • 6
3
votes
1 answer

Hook CTRL+ALT+TAB

I've made a WPF application and I was able to hook some of the windows combinations. ALT+TAB is hooked and it is doing nothing when my application is running (as expected). The problem is when I press the CTRL+ALT+TAB I get the same effect as…
Ricardo Mota
  • 1,194
  • 2
  • 12
  • 25
3
votes
1 answer

How can I do something ~after~ an event has fired in C#?

I'm using the following project to handle global keyboard and mouse hooking in my C# application. This project is basically a wrapper around the Win API call SetWindowsHookEx using either the WH_MOUSE_LL or WH_KEYBOARD_LL constants. It also…
Siracuse
  • 551
  • 2
  • 4
  • 10
3
votes
1 answer

Some windows in Windows 8 prevent my low-level keyboard hook from working

I have an application that uses a low level keyboard hook to capture the user's choice of keyboard shortcuts at a global level to activate the application's main window. Because I want to allow sometimes "odd" shortcuts, like F12 or Ctrl+Ctrl…
Craig Silver
  • 587
  • 4
  • 25
3
votes
2 answers

WinForms: How to prevent textbox from handling alt key and losing focus?

I have this textbox I use to capture keyboard shortcuts for a preferences config. I use a low-level keyboard hook to capture keys and also prevent them from taking action, e.g. the Windows key, but the Alt key still comes through and makes my…
DigiMarco
  • 97
  • 1
  • 2
  • 9