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

Add keymappings for several utility functions #3536

Merged
merged 8 commits into from
Apr 7, 2024
Merged

Conversation

caveman99
Copy link
Member

@caveman99 caveman99 commented Apr 2, 2024

  • map fn+m to mute and unmute the external notification module
  • map fn+t to be an alternative for the TAB key
  • map fn+g to toggle GPS mode
  • map fn+space to send network ping

for @tropho23 with ❤️

@tropho23
Copy link
Contributor

tropho23 commented Apr 2, 2024 via email

@@ -397,6 +398,7 @@ int32_t CannedMessageModule::runOnce()
}
break;
case 0x09: // tab
case 0x91: // fn+t for T-Deck that doesn't have a tab key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T-Deck doesn't have a fn key either, it has an alt key.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alt is mapped to Fn in the t-deck driver... Since cardkb does not have an alt key and sym+t is / (forward slash)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I tried this on my T-Deck and the alt + t did nothing for me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, because of the other bug... whitelist was not updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha... I'll try again when the artifacts are ready.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried the artifact from the latest change and alt+t still doesn't work as tab for the T-Deck 😞

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything helpful in debug log?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nada... It doesn't seem the alt is engaging the fn aspect because all it's doing is typing 't'.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look at the 'probably used' ESP32-C3 keyboard firmware of the T-Deck and it's nothing like the cardkb at all. It looks more like the code used in the BB10 Keyboard, where you have to manage the alt and sym presses yourself. When you press alt, then t, what scancode(s) is/are printed in the debug log?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that level of logging is turned on as I don't see the scan code.

DEBUG | 14:24:30 73 [cardKB] Canned message event any key pressed
DEBUG | 14:24:30 73 [cardKB] showing standard frames
DEBUG | 14:24:30 73 [cardKB] Module wants a UI Frame
DEBUG | 14:24:30 73 [cardKB] Showing 1 module frames
DEBUG | 14:24:30 73 [cardKB] Total frame count: 104
DEBUG | 14:24:30 73 [cardKB] Added modules.  numframes: 1
DEBUG | 14:24:30 73 [cardKB] Finished building frames. numframes: 8

@tropho23
Copy link
Contributor

tropho23 commented Apr 2, 2024

These changes don't work for me; compiled and uploaded to RAK4631 with CardKB, RAK buzzer, external vibramotor and Fn+M (or pressing Fn so the onboard Neopixel flashes green, then pressing M) does not disable the External Notifications module. Same issue with Fn+T, which does not invoke the channel select menu like pressing TAB does.

I also tried changing the key scan codes to see if different ones would work, but they did not.

@HarukiToreda
Copy link
Contributor

I was able to get it working by adding this line "case 0xac: // fn+m" on line 221 of src>input>kbl2cBase.cpp>runOnce()

image

@HarukiToreda
Copy link
Contributor

also must change line 426 in src>module>CannedMessageModule.cpp>runOnce() to "if (moduleConfig.external_notification.enabled = true) {"
image

@caveman99 caveman99 force-pushed the mute-notifications branch from 2e26efe to 61d7ef1 Compare April 3, 2024 17:04
@caveman99
Copy link
Member Author

also must change line 426 in src>module>CannedMessageModule.cpp>runOnce() to "if (moduleConfig.external_notification.enabled = true) {"

"== true", right? or you will set it to true...

@tropho23
Copy link
Contributor

tropho23 commented Apr 4, 2024

The changes from today make Fn+M work to toggle notifications, thanks! I did notice that once I press M (after pressing Fn and see the green LED flashing to include the function key was pressed), notifications are muted but also the device thinks I am starting to type a message, as the message input screen is displayed as if I typed a regular letter. If it does not do that it will work perfectly :)

@HarukiToreda
Copy link
Contributor

The changes from today make Fn+M work to toggle notifications, thanks! I did notice that once I press M (after pressing Fn and see the green LED flashing to include the function key was pressed), notifications are muted but also the device thinks I am starting to type a message, as the message input screen is displayed as if I typed a regular letter. If it does not do that it will work perfectly :)

That's a simple fix, just add "runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;" on lines 429 and 433 so that it keeps the text entry to not activate. @caveman99

image

@caveman99 caveman99 changed the title Mute external notifications from keyboard Add keypappings for several utility functions Apr 4, 2024
@caveman99 caveman99 changed the title Add keypappings for several utility functions Add keymappings for several utility functions Apr 4, 2024
@caveman99 caveman99 force-pushed the mute-notifications branch from 4e27351 to 3dee22b Compare April 4, 2024 09:00
@tropho23
Copy link
Contributor

tropho23 commented Apr 4, 2024

All of these work perfectly, thank you @caveman99 and @HarukiToreda

@tropho23
Copy link
Contributor

tropho23 commented Apr 4, 2024

Also I will submit a feature request to add some screen 'toast' (popup) messages that indicate what the hotkey did.

@thebentern
Copy link
Contributor

Are we good to merge this one now?

@HarukiToreda
Copy link
Contributor

Are we good to merge this one now?

From my testing, all functions work. I believe it's good to merge.

@thebentern thebentern merged commit 1baad28 into master Apr 7, 2024
70 checks passed
@thebentern thebentern deleted the mute-notifications branch April 7, 2024 00:13
@mverch67
Copy link
Collaborator

Can we add all the keymappings into the documentation, e.g. here:
https://meshtastic.org/docs/hardware/devices/tdeck

@rcarteraz
Copy link
Member

Can we add all the keymappings into the documentation, e.g. here: https://meshtastic.org/docs/hardware/devices/tdeck

Probably not best there as these are specific to the CardKB. They do not work on the T-Deck. At least I've been unable to make them work.

@GeneralZodGit
Copy link

I am running firmware 2.3.4 and the ALT + KEY on the T-Deck doesn't work Only ALT-B for the keyboard backlight.

@tropho23
Copy link
Contributor

tropho23 commented Apr 17, 2024 via email

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.

7 participants