diff options
author | Benji Dial <benji6283@gmail.com> | 2020-09-19 14:53:29 -0400 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2020-09-19 14:53:29 -0400 |
commit | de20d7430df08731d9108acb83e1234ba7f1fe16 (patch) | |
tree | 8646f3d1bae3d30391df34766e3e58c0c2af8aab /src/user/knob/user.c | |
parent | 20853582d5385d12421433d21910e783caa00764 (diff) | |
download | portland-os-de20d7430df08731d9108acb83e1234ba7f1fe16.tar.gz |
file manager
Diffstat (limited to 'src/user/knob/user.c')
-rw-r--r-- | src/user/knob/user.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/user/knob/user.c b/src/user/knob/user.c index b642f79..dfcb791 100644 --- a/src/user/knob/user.c +++ b/src/user/knob/user.c @@ -116,10 +116,8 @@ static const uint8_t shifted[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static char get_key_char() { - _key_code_t key; - while (!(key = _get_key())) - _yield_task(); +__attribute__ ((const)) +char key_to_char(_key_code_t key) { return key & _KEY_CAPS ? key & _KEY_SHIFT @@ -130,6 +128,13 @@ static char get_key_char() { : key & 0xff; } +static char get_key_char() { + _key_code_t key; + while (!(key = _get_key())) + _yield_task(); + return key_to_char(key); +} + void tell_user_sz(const char *sz) { _log_string(sz); } |