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

T-Deck: Extra Keyboard Characters #147

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

hreikin
Copy link
Contributor

@hreikin hreikin commented Dec 3, 2023

As mentioned in the discussion thread #146 (comment) here is a PR which provides extra characters to the T-Deck keyboard.

I listen for alt+c which the keyboard firmware provides as a formfeed character, this is used to enable an alternate character mode using a bool. On the next key press if the key pressed has an alternative character configured within the CharMappings struct it will return the alternative character otherwise it will return the original character, then it will reset the bools state to false to mimic the sym key behaviour.

The following extra characters are currently implemented:

Default Alternate Notes
q ~
w %
e |
r %
t {
y }
( [ Requires sym button to be pressed after alt+c
) ] Requires sym button to be pressed after alt+c
u ^
i <
o >
p =
g \
k `
<space> <tab>

In its current state this PR doesn't provide the much needed ctrl and alt keys along with a few other notable omissions like £. These should be able to be implemented with a little extra work/logic as each key can now provide 2 extra characters on top of the ones printed on the keyboard.

I would love to hear your thoughts on the implementation and whether it could be improved.

@bwhitman
Copy link
Collaborator

bwhitman commented Dec 3, 2023

Wow, nice! let me try this out on my T-Deck asap and I'll let you know!

@hreikin
Copy link
Contributor Author

hreikin commented Dec 3, 2023

Awesome, I can't wait to hear what you think.

In regards to providing real ctrl and alt keys I was thinking of using the 2 combinations you currently have set up for ctrl+c and ctrl+x I just haven't had time to try and implement them yet, hopefully it will be sometime this week unless you'd like to try it ?

@hreikin
Copy link
Contributor Author

hreikin commented Dec 5, 2023

I have just pushed a commit which should handle ctrl in much the same way i handle alternate characters and tidy up the logic a bit. Hopefully i will be able to provide a real alt key as well.

@bwhitman bwhitman merged commit 2be5f88 into shorepine:main Dec 6, 2023
@bwhitman
Copy link
Collaborator

bwhitman commented Dec 6, 2023

This is great! I got it going on my T-Deck(s). I love how much cleaner it is now, and all these new characters are available! Thanks for the great documentation too.

@hreikin
Copy link
Contributor Author

hreikin commented Dec 6, 2023

This is great! I got it going on my T-Deck(s). I love how much cleaner it is now, and all these new characters are available! Thanks for the great documentation too.

Awesome, i have got some work done on an implementation for the alt key which includes a few shortcuts and an implementation of the alt-keycodes, i was just finishing up for tonight and going to update the docs in the morning, i'll open a new PR once i get it finished up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants