Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hackergrrl/global-keypress

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

global-keypress

Global key press event emitter.

NOTE: requires sudo privileges.

Supports only Linux right now. Patches for Mac OS and Windows welcome!

About

The program outputs lines to stdout of either the form

pressed <KEY>

or

released <KEY>

It can be used to pipe keypress info into another program, which can capture whatever keys it is interested in.

This approach avoids writing key presses to a logfile, which has worse security properties.

Install

git clone https://github.com/hackergrrl/global-keypress
cd global-keypress
./compile

# sudo bin/globalkeypress

Example

Play a sound effect when the right shift key is pressed.

#!/bin/bash

IFS="\n"
sudo globalkeypress | while read line; do
  if echo $line | grep -q "pressed <RShift>"; then
    aplay -q sfx.wav
  fi
done

License

MIT

About

Global key press event emitter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 91.9%
  • Shell 3.2%
  • JavaScript 2.5%
  • Makefile 2.4%