Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key input handler #1214

Merged
merged 33 commits into from Apr 25, 2023
Merged

Key input handler #1214

merged 33 commits into from Apr 25, 2023

Conversation

byorgey
Copy link
Member

@byorgey byorgey commented Apr 16, 2023

Ability to code your own input handler routines. Closes #102 . Fixes #1210 .

  • Adds a new type key to represent keypresses
  • Adds a primitive function key : text -> key which can handle usual letters, numbers, etc. as well as special keys like "Down" etc, as well as modifier key prefixes like key "A-C-Del". swarm generate keys generates a list of all recognized special key names.
  • New command installKeyHandler : text -> (key -> cmd unit) -> cmd unit which sets the "current key handler". The text value is a hint line to display in the secondary key hints menu while the handler is running. The global shortcut M-k toggles the currently installed handler.
  • Add a keyboard device to provide these commands, as well as a key entity (the recipe for a keyboard is 16 keys + 1 board).
  • Add a few examples in the examples folder.
  • Add an installed keyboard to the building-bridges challenge.

@byorgey byorgey requested a review from kostmo April 17, 2023 09:43
example/pilotmode.sw Outdated Show resolved Hide resolved
src/Swarm/Game/State.hs Outdated Show resolved Hide resolved
@byorgey byorgey added the merge me Trigger the merge process of the Pull request. label Apr 22, 2023
@kostmo kostmo removed the merge me Trigger the merge process of the Pull request. label Apr 22, 2023
data/entities.yaml Outdated Show resolved Hide resolved
@byorgey byorgey requested a review from kostmo April 25, 2023 15:44
@byorgey byorgey added the merge me Trigger the merge process of the Pull request. label Apr 25, 2023
@mergify mergify bot merged commit 599225f into main Apr 25, 2023
10 checks passed
@mergify mergify bot deleted the feature/input-handler branch April 25, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It's possible to get stuck in pilot mode Input handler command
2 participants