diff options
author | Matthias Richter <vrld@vrld.org> | 2013-11-04 21:52:36 +0100 |
---|---|---|
committer | Matthias Richter <vrld@vrld.org> | 2013-11-04 21:52:36 +0100 |
commit | ffd187dc177f4a15fa2e87579b9cbabee38b8245 (patch) | |
tree | 70fcf81f88080286ef71a7b0da601100537b648a /keyboard.lua | |
parent | 935c91f0426852bdcc4a90facb9d4d2afb92d177 (diff) | |
download | Quickie-ffd187dc177f4a15fa2e87579b9cbabee38b8245.tar.gz Quickie-ffd187dc177f4a15fa2e87579b9cbabee38b8245.tar.bz2 Quickie-ffd187dc177f4a15fa2e87579b9cbabee38b8245.tar.xz Quickie-ffd187dc177f4a15fa2e87579b9cbabee38b8245.zip |
Fix #11: Right click support.
When clicked, Button() and Input() return the respective mouse button
constant ('l', 'r', 'm') instead of just true.
When activated by keyboard, Button() and Input() return 'return'.
Otherwise Button() and Input() return false.
Diffstat (limited to 'keyboard.lua')
-rw-r--r-- | keyboard.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/keyboard.lua b/keyboard.lua index 50323ff..4850df3 100644 --- a/keyboard.lua +++ b/keyboard.lua @@ -70,6 +70,10 @@ local function makeCyclable(id) lastwidget = id end +local function pressedOn(id, k) + return (k or 'return') == key and hasFocus(id) and k +end + local function beginFrame() -- for future use? end @@ -88,6 +92,7 @@ return setmetatable({ clearFocus = clearFocus, hasFocus = hasFocus, makeCyclable = makeCyclable, + pressedOn = pressedOn, disable = disable, enable = clearFocus, |