diff options
Diffstat (limited to 'keyboard.lua')
-rw-r--r-- | keyboard.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/keyboard.lua b/keyboard.lua index f6ae2e1..50323ff 100644 --- a/keyboard.lua +++ b/keyboard.lua @@ -34,7 +34,11 @@ local cycle = { next = {key = 'tab'}, } -local function pressed(...) key, code = ... end +local function pressed(...) + key, code = ... + assert(type(key) == 'string', 'Invalid argument `key`. Expected string, got ' .. type(key)) + assert(type(code) == 'number', 'Invalid argument `code`. Expected number, got ' .. type(code)) +end local function setFocus(id) focus = id end local function disable() focus = NO_WIDGET end local function clearFocus() focus = nil end |