A key press event library for C
A simple demonstration is found in main.c
Note: this is meant to be ran in unix/linux/macos systems, I have not tested it on windows
Supports the BASH shell
Events are represented with functions
- Normal events do not return a value and take no parameters
void trigger() {...}
- Global events do not return a value but take a character
- The character is the key that was pressed
void trigger(char ch) {...}
- Reccommended to be used at the end of a multithreaded single keypress function
- Execute this before setting up your events
- Execute this after setting up your events
- Binds a keypress to a function
- The function must be a single keypress function
thread
specifies if you want the event to run on a seperate thread (optional)- Use
USE_MT
orNO_MT
- By default, the trigger will not be multithreaded
- Use
- Example:
use_key('a', key_a_event)
- Triggers a function when any key is pressed
- The function must be a global keypress function
- Example:
use_global(global_event)