diff options
Diffstat (limited to 'src/textbuf_type.h')
-rw-r--r-- | src/textbuf_type.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/textbuf_type.h b/src/textbuf_type.h index e467a70da..d0b75f818 100644 --- a/src/textbuf_type.h +++ b/src/textbuf_type.h @@ -15,6 +15,18 @@ #include "string_type.h" #include "strings_type.h" +/** + * Return values for Textbuf::HandleKeypress + */ +enum HandleKeyPressResult +{ + HKPR_EDITING, ///< Textbuf content changed. + HKPR_CURSOR, ///< Non-text change, e.g. cursor position. + HKPR_CONFIRM, ///< Return or enter key pressed. + HKPR_CANCEL, ///< Escape key pressed. + HKPR_NOT_HANDLED, ///< Key does not affect editboxes. +}; + /** Helper/buffer for input fields. */ struct Textbuf { CharSetFilter afilter; ///< Allowed characters @@ -43,6 +55,8 @@ struct Textbuf { bool DeleteChar(uint16 keycode); bool MovePos(uint16 keycode); + HandleKeyPressResult HandleKeyPress(uint16 key, uint16 keycode); + bool HandleCaret(); void UpdateSize(); |