Commit graph

16 commits

Author SHA1 Message Date
Lephe
bc8b9863ae
touch: plug into event system (+ refactoring)
* Interrupt now at level 15 so it can work in the input timer callback
* Remember last raw/conv/dots and expose unstable API to use it via new
  include <gint/drivers/touch.h>
* Put number of touches in the structures
2025-04-13 11:23:17 +02:00
Lephe
87fff59527
keysc: fix keycodes mapping to multiple keys on Math+ 2025-02-03 23:52:48 +01:00
Lephe
7ac9668dfd
keydev: add Catalog+4th row combo for F1...F6 on Math+ 2025-02-03 23:52:48 +01:00
Lephe
7a479e4f45
keydev: support for the Math+ layout and track row/col
key_event_t is now 8 bytes instead of 4, a change that was doomed to
happen anyway to deal with touch input (where it's not clear either
whether 8 bytes will be enough for double touch).
2025-02-03 23:52:48 +01:00
Lephe
4a2b60b785
keysc: add support for the CP-400 key layout 2024-05-25 18:01:15 +02:00
Lephe
235fa8a361
keydev: fix timing or repeat release 2024-01-07 16:47:51 +01:00
Lephe
6d86c54507
keyboard: add keypressed() and keyreleased() functions 2023-07-24 14:08:23 +02:00
Lephe
db50c9b192
kernel: more options in System ERROR screen
* Add options to RESET, go to menu, or abort()
* Define weak symbols for driver functions so that low-level debugging
  add-ins can be linked with minimal drivers (CPU/INTC/MMU)
2023-01-25 22:38:39 +01:00
Lephe
252bd4eb41
keydev: add low-level filter for async keyboard handlers 2022-11-08 22:22:41 +01:00
Lephe
2b4075c8f9
keysc: have getkey() sleep
This was embarassingly no longer the case since the move to the keydev
API.
2022-09-07 23:25:57 +02:00
Lephe
6ea2f991a3
keysc: make repeat settings global instead of just for getkey()
Having repeat settings only for getkey() meant that repeats that occur
while getkey() is not running (i.e., all of them) would be lost. This is
due to e57efb5e3 which replaced on-demand repeats with normal event
generation.

Now the settings are applied globally, which allows repeats to be
enabled even when getkey() is not active. This also reduces the feature
gap between getkey() and raw events, which reduces the risk of running
into edges cases by using both.

The previous API is retained for source compatibility until gint 3.0 but
the changes are now applied globally so the semantics are slightly
different.
2022-07-24 21:57:18 +01:00
Lephe
e57efb5e37
keysc: simpler keyboard device with more consistent repeats
* Stop trying to be smart and generate repeats on the fly; this breaks
  time consistency. Also if repeats are not handled in time this causes
  infinite loops.
* Move rarely-used functions to external files, simplify stuff, get rid
  of internal driver events; saves ~1 kB per add-in overall.
2022-04-23 13:34:41 +01:00
Lephe
8e730c2f78
replace gint/std headers with standard ones 2021-06-08 11:01:27 +02:00
Lephe
21e91b30d5
keysc: set the key_event_t.mod bit as getkey() did before 2021-05-15 18:37:36 +02:00
Lephe
910677f7ff
getkey: use the new keydev interface
The repeat filter was also changed in favor of a forward-acting
function, which determines repeat delays *before* the repeat actually
occurs.
2021-03-05 14:49:24 +01:00
Lephe
dd564f094a
keydev: add a keyboard device layer to abstract away globals
The new keyboard device (keydev) interface implements the kernel's view
of a keyboard providing input events. Its main role is to abstract all
the globals of the KEYSC driver and getkey functions into a separate
object: the "keyboard device".

The device implements event transformations such as modifiers and
repeats, instead of leaving them to getkey. While this can seem
surprising at first, a real keyboard controller is responsible for
repeats and modifier actions depend on the state of the keyboard which
is only tracked in real-time.

In this commit, getkey() has not changed yet apart from indirectly using
the keydev interface with pollevent(). It will be changed soon to use
event transforms in keydev_read(), and will be left in charge of
providing repeat profiles, handling return-to-menu, backlight changes
and timeouts, all of which are user convenience features.
2021-03-05 09:31:34 +01:00