From b238791002697efbda1ece31985ca15331511fa8 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 1 Aug 2012 14:47:20 +0100 Subject: Use enum instead of magic numbers for tracking key modifier states. Pass special keys to core (e.g. WORD_LEFT, SELECT_ALL, etc). --- framebuffer/fbtk.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'framebuffer/fbtk.h') 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 **********************/ -- cgit v1.2.3