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

Choose summon keybinding #1494

Merged
merged 42 commits into from
Mar 22, 2023
Merged

Choose summon keybinding #1494

merged 42 commits into from
Mar 22, 2023

Conversation

mholtzman
Copy link
Collaborator

@mholtzman mholtzman commented Mar 21, 2023

Allowing users to choose the summon keybinding. Key presses are detected and mapped to an accelerator which is registered using the globalShortcut API. We are still using the experimental keyboard API getLayoutMap to better represent shortcut keys to users with different keyboard layouts (though this does not work in all cases)

https://www.w3.org/TR/uievents-code/#code-value-tables
https://www.electronjs.org/docs/latest/api/accelerator
https://www.electronjs.org/docs/latest/api/global-shortcut
https://developer.mozilla.org/en-US/docs/Web/API/Keyboard/getLayoutMap
https://tkainrad.dev/posts/why-keyboard-shortcuts-dont-work-on-non-us-keyboard-layouts-and-how-to-fix-it

Limitations

Testing

102 key UK keyboard (all platforms) & Macbook Pro UK keyboard (Mac)
Layouts - EN (US), EN (UK), ES (Spain), FR (France), DE (Germany)

Whitelisted Keys

Modifiers - Ctrl, Alt, Meta, Command
Letters - KeyA - KeyZ
Numbers - Digit0 - Digit9
Arrow keys
Punctuation - limited to Comma, Period, Slash as most of these keys are problematic across different layouts.
Function keys - apart from F12 because it doesn't work on Windows.
Numpad keys - apart from Numlock & NumpadEnter, which don't work.
Escape
Space
Enter


TODO:

  • Migration tests
  • Extract functional component
  • Component tests
  • Address PR comments
  • Manual testing (Mac)
  • Manual testing (Windows)
  • Manual testing (Linux)

@socket-security
Copy link

socket-security bot commented Mar 21, 2023

Socket Security Pull Request Report

👍 No new dependency issues detected in pull request

Pull request report summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues
Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

Ignoring: core-js@3.29.1

Powered by socket.dev

@goosewobbler
Copy link
Contributor

@SocketSecurity ignore core-js@3.29.1

@goosewobbler goosewobbler mentioned this pull request Mar 21, 2023
12 tasks
@goosewobbler goosewobbler removed the WIP PRs that are still in progress and not ready for review or merging label Mar 22, 2023
app/dash/Settings/index.js Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
resources/app/index.js Outdated Show resolved Hide resolved
resources/Components/KeyboardShortcutConfigurator/index.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@goosewobbler goosewobbler merged commit f7702e8 into canary Mar 22, 2023
@goosewobbler goosewobbler deleted the keybinding branch March 22, 2023 18:41
mholtzman added a commit that referenced this pull request Mar 22, 2023
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
mholtzman added a commit that referenced this pull request Apr 5, 2023
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
@michaelni
Copy link

Just wanted to confirm that this (0.6.2-canary.2) allows selecting a working summon key on linux. The alt+- default previously did not work for me (nor does alt+- work now if choosen). Didnt investigate why alt+- didnt work. But thanks for fixing this!

mholtzman added a commit that referenced this pull request Apr 10, 2023
* Choose summon keybinding (#1494)

Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>

* remove schema files, update test

* add default shortcuts state

* edit shortcut clarity (#1514)

---------

Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
Co-authored-by: Jordan Muir <jordan@frame.sh>
mholtzman added a commit that referenced this pull request Apr 18, 2023
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
mholtzman added a commit that referenced this pull request Apr 19, 2023
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
mholtzman added a commit that referenced this pull request Apr 19, 2023
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
mholtzman added a commit that referenced this pull request Apr 19, 2023
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
mholtzman added a commit that referenced this pull request Apr 20, 2023
* Integrate pylon evm (#1478)

* bump version

* remove infura and alchemy presets, use pylon

* update package lock

* remove gnosis chain preset

* fix chain name

* move migrations to separate files, use TS (#1482)

* add Zod validation of state chain objects, infer types (#1485)

* add Zod validation of state chain objects, infer types

* move state files to TS, add more inferred types

* fix persist mock for tests

* add types to main state

* update test

* add mute notification schema

* move type export to state main

* move legacy file to TS

* try new migration format

* update legacy migrations and tests

* fix gas fees type

* fix gas type

* move legacy mapping

* final migration prototype

* finish migration poc

* finish cleaning up migrations

* test cleanup

* fix compilation error

* fix state parsing

* Choose summon keybinding (#1494)

Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>

* re-order migrations

* convert hot signers to TS, make tests run reliably

* more commits

* update comment

* remove unneeded assignment

* make worker interaction more typesafe

* remove unused code

* remove unused interface

* fix tests

* revert weird test change

* try revert file

* try move

* decouple worker controller and launch script, write controller tests

* fix worker exit in tests

* remove double cast

* rename some files

* remove ignore

* clean up worker interface

* last cleanup, fix typed data

* more type safety

* rebase, add bip39 type

* remove ts-ignores

* remove rebase artifact

* remove migration files

* update package lock

---------

Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
mholtzman added a commit that referenced this pull request Jun 23, 2023
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
mholtzman added a commit that referenced this pull request Jun 23, 2023
* Integrate pylon evm (#1478)

* bump version

* remove infura and alchemy presets, use pylon

* update package lock

* remove gnosis chain preset

* fix chain name

* move migrations to separate files, use TS (#1482)

* add Zod validation of state chain objects, infer types (#1485)

* add Zod validation of state chain objects, infer types

* move state files to TS, add more inferred types

* fix persist mock for tests

* add types to main state

* update test

* add mute notification schema

* move type export to state main

* move legacy file to TS

* try new migration format

* update legacy migrations and tests

* fix gas fees type

* fix gas type

* move legacy mapping

* final migration prototype

* finish migration poc

* finish cleaning up migrations

* test cleanup

* fix compilation error

* fix state parsing

* Choose summon keybinding (#1494)

Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>

* re-order migrations

* convert hot signers to TS, make tests run reliably

* more commits

* update comment

* remove unneeded assignment

* make worker interaction more typesafe

* remove unused code

* remove unused interface

* fix tests

* revert weird test change

* try revert file

* try move

* decouple worker controller and launch script, write controller tests

* fix worker exit in tests

* remove double cast

* rename some files

* remove ignore

* clean up worker interface

* last cleanup, fix typed data

* more type safety

* rebase, add bip39 type

* remove ts-ignores

* remove rebase artifact

* remove migration files

* update package lock

---------

Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
mholtzman added a commit that referenced this pull request Jul 26, 2023
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants