-
Notifications
You must be signed in to change notification settings - Fork 964
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
Added modifier key combination to allow keyboard shortcuts on t-deck #3668
Conversation
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
|
alt+t does not work on a t-deck so I removed it to avoid confusion.
Although the double button press is a little awkward, this does seem to work. Is the shift + 0 and |
All that the mute and tab code I added do are return the key code for that function, it doesnt actually change any values. All the t-deck thinks is that you are pressing the tab button or a mute button which just so happens to not actually have a phisical button on the keyboard. The code that actually handles the tab and mute functions are in the CannedMessagesModule.cpp My t-deck mutes if it recieves a message before I try to mute it. It seems to reboot only when I mute it before getting a messag. I guess there is a bug in the CannedMessagesModule to figure out with that. |
Related to the added functionality of the 'tab' key, we can remove two lines in the CannedMessagesModule.cpp which were forcing the node and channel selection to only change nodes. On line 164 and 167 of the CannedMessagesModule.cpp you can remove these two lines: Now when typing a message, toggle the tab function once to change nodes (swipe touchscreen or trackball to change nodes) or toggle the tab again to change which channels you are sending on. |
The T-Deck keyboard is quite dumb, comparable to the BBQ10 beyboard we support as well. I just now got a t-deck and intend to port the bbq10 code to it, making sure both keyboards behave the same. It's a similar approach, just with different key combos. |
This enables the node and channel selection to be accessed by pressing the tab shortcut and then swiping between nodes or pressing tab again to change channels. (To access the tab function look at my other pull request meshtastic#3668)
That is amazing! |
@nbaddorf the t-deck kb code is really retarded. I didn't mange to make shift-mic work, however shift-speaker will issue the 0x04 scancode for me. (0x24 minus 0x20) - there are really no other scancodes that are sent from the KB to the host, except alt-c Short of flashing a decent kb firmware to the t-deck (which is not something the average user would do) - what do you think of alt+c as a trigger/escape? it's easier to hit than either shift-mic or shift-speaker... |
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
alt+t does not work on a t-deck so I removed it to avoid confusion.
Thanks for your comment! I didn't know about alt+c and I like that better. The alt+c combo also worked on both t-decks I have access too so I can change that over. I did just notice that one of the t-decks keyboards has more symbols for a different language on it as well as not having the $ symbol printed on the keyboard. |
Alt + c would be much easier! |
I also started working on adding brightness shortcuts. I think the screen is default set to the brightest setting so keep that in mind as I dont think it will be getting any brighter. There is currently code implemented using the OLEDDisplay library for setting brightness. I added functions and keyboard shortcuts to change brightness but the OLEDDisplay library doesnt apear to be set to the backlight pin for the t-decks display. It looks like the backlight is currently being set high from digitalWrite but I dont remember where I found that. I can continue looking into changing that implementation to use the OLEDDisplay command. |
Thanks Caveman99. I looked through CannedMessages but couldnt find any new code. Are you maybe refering to this pull request? #3627 As for a delay when setting the brightness to max, I have no idea what could be causing that, both of my t-decks work just fine with no delay. |
… shows when mute is active or modifier key is pressed. Also fixed some other minor issues.
I would love yalls input, I just added some code to display usefull info in the bottom right corner of the screen like if notifications are muted. Are there any other symbals (letters, not images) that would be usefull to display? Should I even keep this addition? It does sometimes take a second for the symbol to show up, but it is generally pretty quick. I also changed how the keyboard shortcuts were sent to CannedMessages. I added a MODKEY value so that functions we want like muting notifications or changing brightness does not reset the display back to the default screen. Finally I fixed the warning about potentially undefined brightness value. |
I wasn’t happy with my previous implementation, and I think it would have caused issues with other devices. This should work on all devices.
Hey, thinking about it after the fact, I wasn't verry happy with some of the code in my previous implementation so I changed part of it making it simpler, and I dont think it will cause any issues with other devices. Id apretiate it if you would test it and let me know if you have any concerns. I think I am finally done chainging this unless yall want me too! I do see that there is an issue on Github saying that I have conflicts with CannedMessages perticually with the mute notification function. I moved that modifier code to a different location in the file (along with most of the others) to make it work without setting the screen back to the default display. If I have to change something there let me know. I did just see that there was a pull request accepted which added a line to a function I moved so I may have to add that in. (This is my first pull request and I am no master programmer (age 19) so any suggestions would be appreciated.) Thanks! |
Is there any hold backs on merging this? |
Upstream has some changes so we are waiting for the author to resolve the merge conflicts |
This pull request has been mentioned on Meshtastic. There might be relevant details there: https://meshtastic.discourse.group/t/t-deck-firmware-2-3-7-2-3-8/12460/5 |
Sorry, I have been rather busy at home. I will try to get this fixed. |
After updating my T-Deck to 2.3.7 I can no longer swipe left and right or use the ball to change channels. Also, none of the keyboard shortcuts listed here work as written at all. So, unless I connect via bluetooth with a phone, I can only send to the broadcast primary channel now... Shift-0 or ALT-C plus T don't work. |
Yes, this is known. See my previous comment. It’ll be fixed when this is merged and a new release drops. |
…eshtastic#3668) * Updated kbI2cBase.cpp Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab). * Update kbI2cBase.cpp * fixed formatting issues in kbI2cBase.cpp * Removed keyboard shortcut code that doesnt work alt+t does not work on a t-deck so I removed it to avoid confusion. * Updated kbI2cBase.cpp Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab). * Update kbI2cBase.cpp * fixed formatting issues in kbI2cBase.cpp * Removed keyboard shortcut code that doesnt work alt+t does not work on a t-deck so I removed it to avoid confusion. * Changed modifier key to alt+c * Added screen brightness functionality Use modifier key with o(+) to increase brightness or i(-) to decrease. Currently there are 4 levels of brightness, (L, ML, MH, H). I would like to add a popup message to tell you the brightness. * Added checks to disable screen brightness changes on unsupported hardware * Setting the brightness code to work on only applicable devices * Added "function symbol" display to bottom right corner of screen. Now shows when mute is active or modifier key is pressed. Also fixed some other minor issues. * commented out a log * Reworked how modifier functions worked, added I wasn’t happy with my previous implementation, and I think it would have caused issues with other devices. This should work on all devices. * Added back the function I moved causing issue with versions * Fixed the version conflicts, everything seems to work fine now --------- Co-authored-by: Ben Meadors <[email protected]> Co-authored-by: Thomas Göttgens <[email protected]>
The default use of green makes it harder to read. I'm a bit of a long in the tooth noob and botched the pull request and havent got around to having another. Happy for someone else to fix it properly. |
That's what |
OK, so it's perfectly feasible to add #define TFT_MESH COLOR565(0xFF, 0xFF, 0xFF) to the T-Deck variant.h file? That will override the default green values of TFT_MESH COLOR565(0x67, 0xEA, 0x94) in TFTDisplay.cpp? |
yes, that should work. If it doesan't the macro was not added in every screen definiton but that can be rectified :-) |
It appears to have worked OK on my T-Deck. |
The keyboard on the t-deck does not have a 'tab' button or a function button for triggering keyboard shortcuts. I added a 'modifier' key combo that is triggered by pressing shift and the mic (0) button on t-decks keyboard. Then press the letter for the shortcut you want. Currently implemented is: q (quit or cancel), t (tab), and m (mute/unmute).