[client] all: refactor keybind code & functions

This commit is contained in:
Geoffrey McRae
2021-01-26 02:51:03 +11:00
parent e18f7d3365
commit 37b3a26b9c
5 changed files with 39 additions and 40 deletions

View File

@@ -61,9 +61,6 @@ void app_clipboardNotify(const LG_ClipboardData type, size_t size);
void app_clipboardData(const LG_ClipboardData type, uint8_t * data, size_t size);
void app_clipboardRequest(const LG_ClipboardReplyFn replyFn, void * opaque);
typedef struct KeybindHandle * KeybindHandle;
typedef void (*SuperEventFn)(uint32_t sc, void * opaque);
/**
* Show an alert on screen
* @param type The alert type
@@ -72,6 +69,9 @@ typedef void (*SuperEventFn)(uint32_t sc, void * opaque);
*/
void app_alert(LG_MsgAlert type, const char * fmt, ...);
typedef struct KeybindHandle * KeybindHandle;
typedef void (*KeybindFn)(int sc, void * opaque);
/**
* Register a handler for the <super>+<key> combination
* @param sc The scancode to register
@@ -80,7 +80,7 @@ void app_alert(LG_MsgAlert type, const char * fmt, ...);
* @retval A handle for the binding or NULL on failure.
* The caller is required to release the handle via `app_releaseKeybind` when it is no longer required
*/
KeybindHandle app_registerKeybind(int sc, SuperEventFn callback, void * opaque);
KeybindHandle app_registerKeybind(int sc, KeybindFn callback, void * opaque);
/**
* Release an existing key binding