stardot / MatrixBrandy

Matrix Brandy BASIC VI for Linux, Windows, MacOSX
http://brandy.matrixnetwork.co.uk/
44 stars 8 forks source link

Request For Comments: read modifier keys #31

Closed jgharston closed 5 years ago

jgharston commented 5 years ago

I generalised calls from the VDU driver to read the SHIFT keys to a kbd_modkey() call. At the moment the only caller is the VDU driver for paged scrolling, and it passes an argument of 1, kbd_modkey() just tests the SHIFT key but it should be generalisable for other modifier keys - for instance pausing scrolling with Shift+Ctrl.

I have two thoughts about the parameter to pass: the key number or a bitmap of keys. With keynumber, kbd_modkey(1) would test SHIFT, kbd_modkey(2) would test CTRL, kbd_modkey(3) would test ALT, so kbd_modkey(1) | kbd_modkey(2) would test for Shift+Ctrl. With a bitmap, kbd_modkey(1) would test SHIFT, kbd_modkey(2) would test CTRL, kbd_modkey(4) would test ALT, so kbd_modkey(3) would test for Shift+Ctrl.

Thinking forward, which would be the most useful? bitmap optimises the caller, but keynum optimises the callee. The equivalent call in the BBC MOS returns a bitmap.

soruk42 commented 5 years ago

Personally, I'd go with the bitmap.