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.
This commit is contained in:
Matthias Richter 2013-11-04 21:52:36 +01:00
parent 935c91f042
commit ffd187dc17
4 changed files with 14 additions and 5 deletions

View file

@ -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,