diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-05-24 20:49:24 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-05-24 20:49:24 -0700 |
| commit | e5ac52b1d5002a496d1d791e206da6b3a56e8267 (patch) | |
| tree | afb6ea13ebfe69caf3d5d3dbf3217bbfcaaa83f0 /keys.h | |
| parent | 53bee94a9f80246fff5e82206a98931c526e9248 (diff) | |
Added shuffle functionality, cleaned up and improved column drawing, and
did a ton of cleanup of compiler warnings.
Diffstat (limited to 'keys.h')
| -rw-r--r-- | keys.h | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -2,8 +2,8 @@ * Definitions of some key character constants */ -#ifndef _KEYS_DEFINED -#define _KEYS_DEFINED +#ifndef FILE__KEYS_H +#define FILE__KEYS_H #include <poll.h> @@ -87,6 +87,9 @@ #define ESC_DELAY 10 +int term_getkey(int fd, int *mouse_x, int *mouse_y, int timeout); +const char *keyname(int key); + static inline int nextchar(int fd, int timeout) { char c; @@ -174,7 +177,8 @@ int term_getkey(int fd, int *mouse_x, int *mouse_y, int timeout) y = y * 10 + (buf - '0'); if (buf != 'm' && buf != 'M') return -1; - *mouse_x = x - 1, *mouse_y = y - 1; + *mouse_x = x - 1; + *mouse_y = y - 1; if (buf == 'm') return KEY_MOUSE_RELEASE; @@ -205,7 +209,7 @@ int term_getkey(int fd, int *mouse_x, int *mouse_y, int timeout) return -1; } -const char *keyname(key) +const char *keyname(int key) { // TODO: currently only the keys I'm using are named switch (key) { |
