aboutsummaryrefslogtreecommitdiff
path: root/devel.but
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-02-23 22:32:53 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-02-23 23:16:18 +0000
commit9dbcfa765ba59a8201425df18bec09c7bc334c5e (patch)
tree3aeaf692447bb8bbcbfa3cef2afda06cc3d958f7 /devel.but
parent015bd1447472f82a5607ecb5fabaf25bf37cd4e2 (diff)
downloadpuzzles-9dbcfa765ba59a8201425df18bec09c7bc334c5e.zip
puzzles-9dbcfa765ba59a8201425df18bec09c7bc334c5e.tar.gz
puzzles-9dbcfa765ba59a8201425df18bec09c7bc334c5e.tar.bz2
puzzles-9dbcfa765ba59a8201425df18bec09c7bc334c5e.tar.xz
More cleverness in midend_process_key()
It now strips off modifier flags from keys that shouldn't have them and maps printable characters with MOD_CTRL to the corresponding control characters. It also catches Ctrl+Shift+Z because that obviously belongs in the midend. I've updated the JavaScript front-end to take advantage of these changes. Other front ends are unchanged and should work just as they did before.
Diffstat (limited to 'devel.but')
-rw-r--r--devel.but10
1 files changed, 8 insertions, 2 deletions
diff --git a/devel.but b/devel.but
index 366ec03..6496aef 100644
--- a/devel.but
+++ b/devel.but
@@ -3191,8 +3191,9 @@ The front end calls this function to report a mouse or keyboard event.
The parameters \c{x} and \c{y} are identical to the ones passed to the
back end function \cw{interpret_move()} (\k{backend-interpret-move}).
-\c{button} is \e{almost} identical to the parameter passed to
-\cw{interpret_move()}. However, some additional special button values
+\c{button} is similar to the parameter passed to
+\cw{interpret_move()}. However, the midend is more relaxed about
+values passed to in, and some additional special button values
are defined for the front end to pass to the midend (see below).
Also, the front end is \e{not} required to provide guarantees about
@@ -3266,6 +3267,11 @@ items the same, by translating each of them into a button code passed
to the midend, and handle quitting by noticing the \c{false} return
value from \cw{midend_process_key()}.)
+The midend tolerates any modifier being set on any key and removes
+them as necessary before passing the key on to the backend. It will
+also handle translating printable characters combined with
+\cw{MOD_CTRL} into control characters.
+
\H{midend-request-keys} \cw{midend_request_keys()}
\c key_label *midend_request_keys(midend *me, int *nkeys);