segatools/hooklib
Mahuyo a1611afffc Mai2: Add touch and led15070 hook (#55)
In this PR, I have added the `mai2` touch and `led15070` hooks to provide an example for handling custom peripherals. This change allows users to implement the touch and `led15070` logic by writing appropriate `mai2io` scripts.

#### **Touch Hook**:
- The touch hook simulates touch points based on keyboard combinations. For example, to trigger the A1 touch point, the user must press the A and 1 keys on the keyboard. Input for the 1p requires Caps Lock to be off, while 2p requires Caps Lock to be on.
- The hook allows for independent control of whether device simulation is enabled for "1p" and "2p" and whether keyboard input mapping is enabled.
- **Note**: The current touch hook is not yet functional as it requires modifications to the `capnhook` for proper completion of the `sinmai` hook.

#### **LED15070 Hook**:
- This hook implements basic device simulation. Peripherals requiring lighting data should complete the logic as needed.
- **Note**: The LED data refresh can flood the console logs, so I’ve added a `DEBUG` flag to control whether the debug logging is enabled or not.

#### **Other Changes**:
- In certain versions of `sinmai`, key inputs for 1p and 2p can be directly read from the keyboard without requiring simulation via the `amdaemon io4` hook. I’ve added a switch to control this behavior to prevent redundant input.
- **Benefit**: This ensures that key input is only read when `sinmai` is in the foreground.

If you'd like to learn more about the touch and `led15070` features, my research findings are available here:
[Mai2Touch](https://github.com/Sucareto/Mai2Touch)

Co-authored-by: Sucareto <28331534+Sucareto@users.noreply.github.com>
Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/55
Co-authored-by: Mahuyo <mahuyo@noreply.gitea.tendokyu.moe>
Co-committed-by: Mahuyo <mahuyo@noreply.gitea.tendokyu.moe>
2025-02-16 12:49:58 +00:00
..
config.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
config.h fgo: fgohook finally added 2023-11-11 23:05:11 +01:00
createprocess.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
createprocess.h createprocess: add replace_all flag 2023-09-15 19:57:11 -04:00
cursor.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
cursor.h carol: somewhat-working touch board?? 2023-11-27 23:23:00 -05:00
dll.c removed prints, added phantom device 2023-02-13 03:07:36 -05:00
dll.h gfxhook: Fix some clang-tidy warnings 2023-02-13 03:07:37 -05:00
dns.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
dns.h dns: add port overriding support 2024-12-12 02:28:02 +08:00
dvd.c dvd: move thread safety comment into header file 2021-06-17 04:13:50 +02:00
dvd.h dvd: move thread safety comment into header file 2021-06-17 04:13:50 +02:00
fdshark.c hooklib: Split out of util 2019-05-14 17:13:08 -04:00
fdshark.h hooklib: Split out of util 2019-05-14 17:13:08 -04:00
meson.build remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
path.c added Move/Replace/Delete hooks 2024-02-27 16:54:12 +01:00
path.h hooklib/path.c: add function to hook apply path hooks to another module 2020-05-21 00:58:20 +00:00
printer.c Fix build with Microsoft Visual C++, Fix gfxhook and felica issue (#48) 2024-11-11 16:28:24 +00:00
printer.h printer: add ability to delay printing 2024-09-27 11:06:18 +02:00
reg.c Mai2: Add touch and led15070 hook (#55) 2025-02-16 12:49:58 +00:00
reg.h switched to new capnhook, updated unityhook, added LED 15093 to MU3 2024-05-12 19:37:30 +02:00
setupapi.c fgo: working FTDI hook by @OLEG 2023-11-22 21:43:42 +01:00
setupapi.h added setupapi hook to elisabeth 2023-02-13 03:07:36 -05:00
spike.c remove 5gb wasted space by removing precompiled headers 2024-12-23 21:04:51 +01:00
spike.h hooklib/spike.c: Add a measure of configurability 2019-10-19 16:15:14 -04:00
touch.c switched to new capnhook, updated unityhook, added LED 15093 to MU3 2024-05-12 19:37:30 +02:00
touch.h switched to new capnhook, updated unityhook, added LED 15093 to MU3 2024-05-12 19:37:30 +02:00