Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds keyboard remapping support.
The actual reason I am implementing this is because the Apple IIGS uses the "power" key on an ADB keyboard as a "reset" key, and the reset key is extremely important in Apple II land. Actually I would argue that it IS a reset key, not a power key, because the IIGS is the first machine with ADB. In any case, virtually no PC keyboards have a power/reset key, because why would they? There is a key scan code for it, so it seems like a reasonable thing for a user to just remap some other key to be the power key. (Note that currently this doesn't work, because the ADB card firmware handles the power key incorrectly, but we'll get there, baby steps 😉)
I imagine this could be useful for other things too, like if you want to play an old shooter that uses arrow keys, and you are used to WASD.
The actual remappings are loaded from JSON files with basically the same format as gamepad remappings except that you specify
protocol_list_keyboardfordevice_typeand setprotocol_boardandprotocol_nameaccordingly. Here's an example:{ "device_type": "protocol_list_keyboard", "display_name": "ADB F16->PWR", "mapping": {"KEY_F16": {"code": "KEY_POWER"}}, "protocol_board": "Lisa/Mac/ADB", "protocol_name": "ADB_KB" }There will be a corresponding PR opened for the configurator to allow you to easily generate this JSON files.