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 Missing Keyboard Settings keycodes #1204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 73 additions & 3 deletions src/store/modules/keycodes/kb-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,76 @@ export default [
title: 'Swap Ctrl and GUI on both sides (for macOS)',
width: 1500
},
{
name: 'Swap Caps/Esc',
code: 'EC_SWAP',
title: 'Swap Caps Lock and Escape',
width: 1500
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we're using the same width in a lot of places, you can replace this with a constant.

},
{
name: 'Split Master is Left Hand',
code: 'EH_LEFT',
title: 'Set the master half of a split keyboard as the left hand (for EE_HANDS)',
width: 2000
},
{
name: 'Split Master is Right Hand',
code: 'EH_RGHT',
title: 'Set the master half of a split keyboard as the right hand (for EE_HANDS)',
width: 2000
},
{
width: 0
},
{
name: 'Toggle LCtl/Caps',
code: 'CL_TOGG',
title: 'Toggle Caps Lock and Left Control swap',
width: 1500
},
{
width: 3000
},
{
width: 3000
},
{
width: 1500
},
Comment on lines +105 to +113
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how I feel about this bit...

Copy link
Collaborator

@yanfali yanfali Nov 9, 2022

Choose a reason for hiding this comment

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

You could create an alias to an object like so:

const blank3000Row = { width: 3000 };

and then use it like so:

...blank3000Row

or without the spread operator depending on how you surround it

Copy link
Member Author

Choose a reason for hiding this comment

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

The issue I'm having with this is that I need a space that's 7.5 key units, but there isn't a spacer class in the CSS for one.

I could add one of course, but I don't think that's a scalable solution.

{
name: 'Toggle GUI',
code: 'GUI_TOG',
title: 'Toggles the status of the GUI keys',
width: 1500
},
{
width: 3000
},
{
name: 'Toggle NKRO',
code: 'NK_TOGG',
title: 'Toggle N-Key Rollover (NKRO)',
width: 1500
},
{
name: 'Rev Alt/GUI',
code: 'AG_TOGG',
title: 'Toggle Alt and GUI swap on both sides',
width: 1500
},
{
name: 'Unswap Ctl/GUI',
code: 'CG_TOGG',
title: 'Toggle Control and GUI swap on both sides',
width: 1500
},
{
name: 'Toggle Caps/Esc',
code: 'EC_TOGG',
title: 'Toggle Caps Lock and Escape swap',
width: 1500
},

{
width: 0
},
Expand Down Expand Up @@ -151,9 +221,9 @@ export default [
width: 1500
},
{
name: 'Toggle NKRO',
code: 'NK_TOGG',
title: 'Turn NKRO on or off',
name: 'Unswap Caps/Esc',
code: 'EC_NORM',
title: 'Unswap Caps Lock and Escape',
width: 1500
},

Expand Down