rename modifier_down to key_down
The old name was confusing, as its description showed.
This commit is contained in:
parent
637e28f300
commit
9e17337217
4
app.lua
4
app.lua
|
@ -229,7 +229,7 @@ end
|
||||||
function App.fake_key_release(key)
|
function App.fake_key_release(key)
|
||||||
App.fake_keys_pressed[key] = nil
|
App.fake_keys_pressed[key] = nil
|
||||||
end
|
end
|
||||||
function App.modifier_down(key)
|
function App.key_down(key)
|
||||||
return App.fake_keys_pressed[key]
|
return App.fake_keys_pressed[key]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ function App.disable_tests()
|
||||||
App.getTime = love.timer.getTime
|
App.getTime = love.timer.getTime
|
||||||
App.getClipboardText = love.system.getClipboardText
|
App.getClipboardText = love.system.getClipboardText
|
||||||
App.setClipboardText = love.system.setClipboardText
|
App.setClipboardText = love.system.setClipboardText
|
||||||
App.modifier_down = love.keyboard.isDown
|
App.key_down = love.keyboard.isDown
|
||||||
App.mouse_move = love.mouse.setPosition
|
App.mouse_move = love.mouse.setPosition
|
||||||
App.mouse_down = love.mouse.isDown
|
App.mouse_down = love.mouse.isDown
|
||||||
App.mouse_x = love.mouse.getX
|
App.mouse_x = love.mouse.getX
|
||||||
|
|
|
@ -34,19 +34,19 @@ function App.any_modifier_down()
|
||||||
end
|
end
|
||||||
|
|
||||||
function App.ctrl_down()
|
function App.ctrl_down()
|
||||||
return App.modifier_down('lctrl') or App.modifier_down('rctrl')
|
return App.key_down('lctrl') or App.key_down('rctrl')
|
||||||
end
|
end
|
||||||
|
|
||||||
function App.alt_down()
|
function App.alt_down()
|
||||||
return App.modifier_down('lalt') or App.modifier_down('ralt')
|
return App.key_down('lalt') or App.key_down('ralt')
|
||||||
end
|
end
|
||||||
|
|
||||||
function App.shift_down()
|
function App.shift_down()
|
||||||
return App.modifier_down('lshift') or App.modifier_down('rshift')
|
return App.key_down('lshift') or App.key_down('rshift')
|
||||||
end
|
end
|
||||||
|
|
||||||
function App.cmd_down()
|
function App.cmd_down()
|
||||||
return App.modifier_down('lgui') or App.modifier_down('rgui')
|
return App.key_down('lgui') or App.key_down('rgui')
|
||||||
end
|
end
|
||||||
|
|
||||||
function App.is_cursor_movement(key)
|
function App.is_cursor_movement(key)
|
||||||
|
|
|
@ -251,8 +251,7 @@ visible on screen.
|
||||||
|
|
||||||
### keyboard primitives
|
### keyboard primitives
|
||||||
|
|
||||||
* `App.modifier_down(key)` -- returns `true` if the given key (doesn't
|
* `App.key_down(key)` -- returns `true` if the given key is currently pressed.
|
||||||
actually have to be just a modifier) is currently pressed.
|
|
||||||
(Based on [LÖVE](https://love2d.org/wiki/love.keyboard.isDown).)
|
(Based on [LÖVE](https://love2d.org/wiki/love.keyboard.isDown).)
|
||||||
|
|
||||||
### interacting with files
|
### interacting with files
|
||||||
|
|
Loading…
Reference in New Issue