summaryrefslogtreecommitdiff
path: root/framebuffer/fbtk.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-08-01 14:47:20 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-08-01 14:47:20 +0100
commitb238791002697efbda1ece31985ca15331511fa8 (patch)
tree099a9c336f66ada1daff6642649d1059505ea571 /framebuffer/fbtk.h
parent46527795dbf69f08d55692fa1ca85b54a6bcc4dc (diff)
downloadnetsurf-b238791002697efbda1ece31985ca15331511fa8.tar.gz
netsurf-b238791002697efbda1ece31985ca15331511fa8.tar.bz2
Use enum instead of magic numbers for tracking key modifier states. Pass special keys to core (e.g. WORD_LEFT, SELECT_ALL, etc).
Diffstat (limited to 'framebuffer/fbtk.h')
-rw-r--r--framebuffer/fbtk.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/framebuffer/fbtk.h b/framebuffer/fbtk.h
index f2b09e51f..220700fef 100644
--- a/framebuffer/fbtk.h
+++ b/framebuffer/fbtk.h
@@ -74,6 +74,15 @@ struct fbtk_bitmap {
int hot_y;
};
+/* Key modifier status */
+typedef enum fbtk_modifier_type {
+ FBTK_MOD_CLEAR = 0,
+ FBTK_MOD_LSHIFT = (1 << 0),
+ FBTK_MOD_RSHIFT = (1 << 1),
+ FBTK_MOD_LCTRL = (1 << 2),
+ FBTK_MOD_RCTRL = (1 << 3)
+} fbtk_modifier_type;
+
typedef int (*fbtk_callback)(fbtk_widget_t *widget, fbtk_callback_info *cbi);
/* enter pressed on writable icon */
@@ -198,7 +207,7 @@ bool fbtk_tgrab_pointer(fbtk_widget_t *widget);
*
* Character mapping between keycode with modifier state and ucs-4.
*/
-int fbtk_keycode_to_ucs4(int code, uint8_t mods);
+int fbtk_keycode_to_ucs4(int code, fbtk_modifier_type mods);
/******************* Widget Information **********************/