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:
parent
935c91f042
commit
ffd187dc17
4 changed files with 14 additions and 5 deletions
|
@ -74,5 +74,5 @@ return function(w)
|
|||
core.registerDraw(id, w.draw or core.style.Input,
|
||||
w.info.text, w.info.cursor, pos[1],pos[2], size[1],size[2])
|
||||
|
||||
return mouse.releasedOn(id) or (keyboard.key == 'return' and keyboard.hasFocus(id))
|
||||
return mouse.releasedOn(id) or keyboard.pressedOn(id, 'return')
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue