Skip to content

Validate hotkey when setting it #1770

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

Merged
merged 14 commits into from
Jan 18, 2023

Conversation

VictoriousRaptor
Copy link
Contributor

@VictoriousRaptor VictoriousRaptor commented Jan 9, 2023

  • Prevent user from setting single "Alt" "Ctrl" "Shift" "Win" as hotkey. Fix flow launcher got an error #1755.
  • Prevent setting single alphanumeric key as hotkey.
    • When a pressed hotkey is unavailable, stay focused inside the text box so user can continue to try a new hotkey.
  • When clicked away and the hotkey is unavailable, return to the previous set hotkey.

Tests:

  • Toggle hotkey can be modified.
  • Preview hotkey can be modified.
  • Single special key can't be set as hotkey.
  • Single function key can be set as hotkey.
  • Single alphanumeric key can't be set as hotkey.
  • When a pressed hotkey is unavailable, stay focused inside the text box so user can continue to try a new hotkey.
  • When clicked away and the hotkey is unavailable, return to the previous set hotkey.

@VictoriousRaptor VictoriousRaptor self-assigned this Jan 9, 2023
@VictoriousRaptor VictoriousRaptor added the bug Something isn't working label Jan 9, 2023
@VictoriousRaptor VictoriousRaptor added this to the 1.11.1 milestone Jan 9, 2023
jjw24
jjw24 previously requested changes Jan 10, 2023
Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

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

Can we:

  1. When a hotkey is unavailable, stay focused inside the text box so user can continue to try new hotkey.
  2. When clicked away and the hotkey is unavailable, return to the previous set hotkey.

@taooceros
Copy link
Member

taooceros commented Jan 11, 2023

I just remember I have a very old pr regarding this #933. Well but it is a bit hacky....

@jjw24 jjw24 added the review in progress Indicates that a review is in progress for this PR label Jan 11, 2023
@VictoriousRaptor VictoriousRaptor deleted the FixPreviewHotkey branch January 13, 2023 06:49
@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Jan 16, 2023
@VictoriousRaptor VictoriousRaptor restored the FixPreviewHotkey branch January 18, 2023 08:36
@VictoriousRaptor
Copy link
Contributor Author

Closed by accident somehow.

@VictoriousRaptor
Copy link
Contributor Author

Can we:

1. When a hotkey is unavailable, stay focused inside the text box so user can continue to try new hotkey.

2. When clicked away and the hotkey is unavailable, return to the previous set hotkey.

Please review again.

@VictoriousRaptor VictoriousRaptor added the review in progress Indicates that a review is in progress for this PR label Jan 18, 2023
@VictoriousRaptor VictoriousRaptor linked an issue Jan 18, 2023 that may be closed by this pull request
{
return !((CharKey >= Key.A && CharKey <= Key.Z) ||
(CharKey >= Key.D0 && CharKey <= Key.D9) ||
(CharKey >= Key.NumPad0 && CharKey <= Key.NumPad9));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checking for all symbol keys are too difficult so I just ban alphanumeric keys.

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

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

👍

@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Jan 18, 2023
@jjw24 jjw24 merged commit d2cc576 into Flow-Launcher:dev Jan 18, 2023
@jjw24 jjw24 modified the milestones: 1.11.1, 1.12.0 Jan 22, 2023
@VictoriousRaptor VictoriousRaptor deleted the FixPreviewHotkey branch February 6, 2023 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
3 participants