From 9e173372178c2df1dd3f6599dea5fe3c37675c6e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 5 Jun 2023 22:21:04 -0700 Subject: rename modifier_down to key_down The old name was confusing, as its description showed. --- reference.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'reference.md') diff --git a/reference.md b/reference.md index 3234cfa..525ae86 100644 --- a/reference.md +++ b/reference.md @@ -251,8 +251,7 @@ visible on screen. ### keyboard primitives -* `App.modifier_down(key)` -- returns `true` if the given key (doesn't - actually have to be just a modifier) is currently pressed. +* `App.key_down(key)` -- returns `true` if the given key is currently pressed. (Based on [LÖVE](https://love2d.org/wiki/love.keyboard.isDown).) ### interacting with files -- cgit 1.4.1-2-gfad0 From fc094496c1a8b4d89faba8eeadc213e886217f9f Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 5 Jun 2023 22:22:53 -0700 Subject: document a few more keyboard primitives --- reference.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'reference.md') diff --git a/reference.md b/reference.md index 525ae86..3426d25 100644 --- a/reference.md +++ b/reference.md @@ -251,6 +251,15 @@ visible on screen. ### keyboard primitives +* `App.is_cursor_movement(key)` -- return `true` if `key` is a cursor movement + key (arrow keys, page-up/down, home/end) + +* `App.cmd_down()`, `App.ctrl_down`, `App.alt_down()`, `App.shift_down()` -- + predicates for different modifier keys. + +* `App.any_modifier_down()` -- returns `true` if any of the modifier keys is + currently pressed. + * `App.key_down(key)` -- returns `true` if the given key is currently pressed. (Based on [LÖVE](https://love2d.org/wiki/love.keyboard.isDown).) -- cgit 1.4.1-2-gfad0 From f1981e85db8cc349dc1e4cfa4cddb6e83ae2ad17 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 5 Jun 2023 22:23:25 -0700 Subject: document a couple of miscellaneous helpers --- reference.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'reference.md') diff --git a/reference.md b/reference.md index 3426d25..802c99d 100644 --- a/reference.md +++ b/reference.md @@ -317,6 +317,12 @@ and [the Lua manual](https://www.lua.org/manual/5.1/manual.html#5.7). * `App.setClipboardText(text)` -- stores the string `text` in the clipboard. (Based on [LÖVE](https://love2d.org/wiki/love.system.setClipboardText).) +* `array.find(arr, elem)` -- scan table `arr` for `elem` assuming it's + organized as an array (just numeric indices). + +* `array.any(arr, f)` -- scan table `arr` for any elements satisfying + predicate `f`. Return first such element or `false` if none. + There's much more I could include here; check out [the LÖVE manual](https://love2d.org/wiki) and [the Lua manual](https://www.lua.org/manual/5.1/manual.html). -- cgit 1.4.1-2-gfad0