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

feat: Extras, tap-hold, and modifier keys #148

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Aug 30, 2022

Initial implementation of #146.

Backend representation for mod-tap, layer-tap, and modifiers+basic keycode, with conversion to and from text format and numeric keycode.

Add shift-select for modifiers with a non-modifier key, extras tab, and tap-hold section.

Sensitivity needs to be set based on whether shift is held and what is already selected. Getting this to work properly is awkward with how GTK modifiers are handled. More things need to be added to extras, the layout for basic keys needs to be updated for the latest design, and various style details need to be addressed. And it needs to not show these things for internal keycodes.

@ids1024 ids1024 force-pushed the configurator-feature-update branch 2 times, most recently from 0b19677 to 645c03e Compare September 12, 2022 21:10
@ids1024
Copy link
Member Author

ids1024 commented Oct 25, 2022

I've been busy with Cosmic and Iced related things, and sizing and alignment of the keycode picker has posed a bit of a challenge, but anyway, functionally this should be working. Some things may need to be fixed, and we may want to adjust the style of some things.

To test, it should now be possible to just run apt-manage add popdev:configurator-feature-update, followed by apt update and apt upgrade.

DP-4_1666654803
DP-4_1666654830
DP-4_1666654833

So the problem I've had with sizing and centering of the keycode picker: it's using a custom PickerGroupBox widget to display the picker groups in a way that can reflow depending on available space. The way it determined how much size to request doesn't work so well now with the group for basic keycodes layout out like an ANSI keyboard (wider than previous groups). Also the way it was handling centering only worked for centering the PickerGroupBox, but now it's in GtkStack, etc, and those should be aligned similarly.

I spend some time trying to find a way to make the natural size it requests depending on how it reflows (which isn't really possible; but perhaps that's not the issue, or only part of it). Currently I have it set to allocate the same width as the widest group, which looks alright but seems a bit narrow on wide windows. But allowing it to scale to, say, 1.2 times this just makes it look off center. Unless the individual groups were centered.

Initial implementation of
#146.

Backend representation for mod-tap, layer-tap, and modifiers+basic
keycode, with conversion to and from text format and numeric keycode.

Add shift-select for modifiers with a non-modifier key, extras tab, and
tap-hold section.

Sensitivity needs to be set based on whether shift is held and what is
already selected. Getting this to work properly is awkward with how GTK
modifiers are handled. More things need to be added to extras, the
layout for basic keys needs to be updated for the latest design, and
various style details need to be addressed. And it needs to not show
these things for internal keycodes.
Update sensitivity based on state of `shift` key.

Distinguish basic from non-basic keycodes. Non-basic not allowed with
shift select.

Show "Left" or "Right" only once when multiple modifiers are combined.

Update how internal state is handled in tap-hold, render with line
separator, and handle shift-select.

Show QMK features only on QMK keyboard, using a `is_qmk` `meta.json`
setting. Only allow shift-select where this is enabled. Also only apply
QMK features in backend crate when QMK layout is used.
This will allow parts of the picker to be defined without this style of
section, and also lays the groundwork for showing different labels for
international keyboard layouts.

How/if to translate is still unclear.
This design allows custom widgets for specific groups, and uses one for
the international keys.
Now it is centered using `halign`. This can now be better positioned
relative to other widgets.
This more or less works. Scaling in increments doesn't seem to be
possible, so centering is really only possible for the group box alone,
or with a limit to width.
@ids1024 ids1024 force-pushed the configurator-feature-update branch 2 times, most recently from 4e38fb6 to b7e51ca Compare November 22, 2022 00:10
@maria-komarova
Copy link

maria-komarova commented Mar 16, 2023

Looking at the configurator and after some chat exchange:

  • Currently, one can't switch between tabs (Basics, Extras and Tap-Hold) before clicking on the key on the keymap. It might be good to allow people to switch between tabs even if the keycodes are disabled before someone chooses the key.
  • Let's try the following order for the keycode groups under Basics: main ISO layout, Navigation, Other actions, Other ANSI/ISO symbols, Controls, LED controls, Media, Layer keys, Numpad. Same order on the Tap-Hold tab.
  • The spacing from the view switcher to the content underneath (for example, first keycode row) should be 18px, looks smaller in testing.
  • Double check the spacing between "rows" of keycode groups, should be 36px, can't quite figure out if it is smaller than that. Same for steps on Tap-Hold.
  • The spacing between the first keycode group (main layout) and the copy "Shift + click..." under it seems too tight. Let's try 12px. Same applies to the "Shift+click..." copy under modifier keycodes under Tap-Hold.
  • Spacing between keycodes inside each group in the keycode picker is not consistent. We have 2px on the mockups on all of them. Looks like main layout and Numpad has something similar to this so it would be good to make sure other groups have the same across all tabs.
  • When I choose Left Shift for the modifier under Tap-Hold, then choose Access Layer 1, the selection doesn't move to Access Layer 1. It gets highlighted with blue background but modifier function doesn't get remapped. Seems like a bug because it moved after the second attempt.
  • I've noticed we have Shift + Click to combine modifiers for Tap-Hold under the main layout keycode group. But it doesn't look like one can actually combine them. We might want to remove the copy on this tab then.
  • Let's try using horizontal scroll when the window gets too narrow to fit the keycodes.

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.

2 participants