Word Unperfect
public
Read
Owner: themaster
Branch: main
Commits: 0
Git CLI clone URL
git clone https://www.xt-emporium.com/git/word-unperfect.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
word-unperfect
/
rev
/
wp_key_dispatcher.h
File editor
#ifndef WP_KEY_DISPATCHER_H #define WP_KEY_DISPATCHER_H #include <stdint.h> #include <stdbool.h> /* WP 5.1 Modifier Flags */ #define WP_MOD_SHIFT 0x01 #define WP_MOD_CTRL 0x02 #define WP_MOD_ALT 0x04 typedef enum { WP_CMD_NONE, WP_CMD_EXIT, /* F7 */ WP_CMD_SAVE, /* F10 */ WP_CMD_REVEAL, /* Alt-F3 */ WP_CMD_HELP, /* F3 */ WP_CMD_CANCEL, /* F1 */ WP_CMD_LIST, /* F5 */ WP_CMD_PRINT /* Shift-F7 */ } WpCommand; typedef enum WpKeyBindingKind { WP_KEY_BINDING_EMPTY = 0, WP_KEY_BINDING_LITERAL, WP_KEY_BINDING_MACRO, WP_KEY_BINDING_COMMAND, WP_KEY_BINDING_MACRO_COMMAND, WP_KEY_BINDING_OTHER } WpKeyBindingKind; typedef struct WpKeyBindingAction { WpKeyBindingKind kind; uint16_t raw_entry; uint8_t id; WpCommand command; } WpKeyBindingAction; typedef struct WpKeyState { uint8_t modifiers; uint16_t last_key; bool waiting_for_confirmation; WpCommand pending_command; WpCommand last_command; } WpKeyState; /* Function prototypes */ void wp_key_init(WpKeyState *ks); void wp_key_process(WpKeyState *ks, uint16_t scancode, uint8_t modifiers); WpCommand wp_key_consume_command(WpKeyState *ks); WpCommand wp_key_command_for_scancode(uint16_t scancode, uint8_t modifiers); bool wp_key_decode_binding(uint16_t raw_entry, WpKeyBindingAction *out_action); void wp_macro_execute(const char *filename); #endif
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
main
Visibility
public
Your access
Read
Remote
None
File activity
View file history