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

Why are key_symbol and command and string mappings limited to 10? #10

Open
talenelat-elin opened this issue Feb 21, 2023 · 3 comments
Open

Comments

@talenelat-elin
Copy link

And would it be trivial to increase the number of these mappings?

@svenlr
Copy link
Owner

svenlr commented Feb 21, 2023

Hi,
the reason is that in order to achieve these types of mappings, the script searches the current xkb configuration for key codes that are unused yet (i.e. no keys or actions are assigned) in order to assign new keys.
The script should also print the number of remaining unused key codes when running it. There seem to be about 10 out of 255 that are not assigned to anything so I decided I could safely re-purpose them.
In order to increase this number, we can find other key codes that are mapped to something but not important. However, re-purposing this should be done with care as they are probably tied to some shortcut in the UI. This could allow some additional mappings.
Here is a part of my current system's config, which shows all these XF86 stuff and it seems, some of them might be not so important. You can also see the ones created by the script in the bottom (backslash, etc...):

    key <I148> {         [  XF86Calculator ] };
    key <I150> {         [       XF86Sleep ] };
    key <I151> {         [      XF86WakeUp ] };
    key <I152> {         [    XF86Explorer ] };
    key <I153> {         [        XF86Send ] };
    key <I155> {         [        XF86Xfer ] };
    key <I156> {         [     XF86Launch1 ] };
    key <I157> {         [     XF86Launch2 ] };
    key <I158> {         [         XF86WWW ] };
    key <I159> {         [         XF86DOS ] };
    key <I160> {         [ XF86ScreenSaver ] };
    key <I161> {         [ XF86RotateWindows ] };
    key <I162> {         [    XF86TaskPane ] };
    key <I163> {         [        XF86Mail ] };
    key <I164> {         [   XF86Favorites ] };
    key <I165> {         [  XF86MyComputer ] };
    key <I166> {         [        XF86Back ] };
    key <I167> {         [     XF86Forward ] };
    key <I169> {         [       XF86Eject ] };
    key <I170> {         [       XF86Eject,       XF86Eject ] };
    key <I171> {         [   XF86AudioNext ] };
    key <I172> {         [   XF86AudioPlay,  XF86AudioPause ] };
    key <I173> {         [   XF86AudioPrev ] };
    key <I174> {         [   XF86AudioStop,       XF86Eject ] };
    key <I175> {         [ XF86AudioRecord ] };
    key <I176> {         [ XF86AudioRewind ] };
    key <I177> {         [       XF86Phone ] };
    key <I179> {         [       XF86Tools ] };
    key <I180> {         [    XF86HomePage ] };
    key <I181> {         [      XF86Reload ] };
    key <I182> {         [       XF86Close ] };
    key <I185> {         [    XF86ScrollUp ] };
    key <I186> {         [  XF86ScrollDown ] };
    key <I187> {         [       parenleft ] };
    key <I188> {         [      parenright ] };
    key <I189> {         [         XF86New ] };
    key <I190> {         [            Redo ] };
    key <FK13> {         [       XF86Tools ] };
    key <FK14> {         [     XF86Launch5 ] };
    key <FK15> {         [     XF86Launch6 ] };
    key <FK16> {         [     XF86Launch7 ] };
    key <FK17> {         [     XF86Launch8 ] };
    key <FK18> {         [     XF86Launch9 ] };
    key <FK20> {         [ XF86AudioMicMute ] };
    key <FK21> {         [ XF86TouchpadToggle ] };
    key <FK22> {         [  XF86TouchpadOn ] };
    key <FK23> {         [ XF86TouchpadOff ] };
    key <MDSW> {         [     Mode_switch ] };
    key  <ALT> {         [        NoSymbol,           Alt_L ] };
    key <META> {         [        NoSymbol,          Meta_L ] };
    key <SUPR> {         [        NoSymbol,         Super_L ] };
    key <HYPR> {         [        NoSymbol,         Hyper_L ] };
    key <I208> {         [   XF86AudioPlay ] };
    key <I209> {         [  XF86AudioPause ] };
    key <I210> {         [     XF86Launch3 ] };
    key <I211> {         [     XF86Launch4 ] };
    key <I212> {         [     XF86LaunchB ] };
    key <I213> {         [     XF86Suspend ] };
    key <I214> {         [       XF86Close ] };
    key <I215> {         [   XF86AudioPlay ] };
    key <I216> {         [ XF86AudioForward ] };
    key <I218> {         [           Print ] };
    key <I220> {         [      XF86WebCam ] };
    key <I221> {         [ XF86AudioPreset ] };
    key <I223> {         [        XF86Mail ] };
    key <I224> {         [   XF86Messenger ] };
    key <I225> {         [      XF86Search ] };
    key <I226> {         [          XF86Go ] };
    key <I227> {         [     XF86Finance ] };
    key <I228> {         [        XF86Game ] };
    key <I229> {         [        XF86Shop ] };
    key <I231> {         [          Cancel ] };
    key <I232> {         [ XF86MonBrightnessDown ] };
    key <I233> {         [ XF86MonBrightnessUp ] };
    key <I234> {         [  XF86AudioMedia ] };
    key <I235> {         [     XF86Display ] };
    key <I236> {         [ XF86KbdLightOnOff ] };
    key <I237> {         [ XF86KbdBrightnessDown ] };
    key <I238> {         [ XF86KbdBrightnessUp ] };
    key <I239> {         [        XF86Send ] };
    key <I240> {         [       XF86Reply ] };
    key <I241> {         [ XF86MailForward ] };
    key <I242> {         [        XF86Save ] };
    key <I243> {         [   XF86Documents ] };
    key <I244> {         [     XF86Battery ] };
    key <I245> {         [   XF86Bluetooth ] };
    key <I246> {         [        XF86WLAN ] };
    key <I248> {         [       backslash ] };
    key <I249> {         [      braceright ] };
    key <I250> {         [    bracketright ] };
    key <I251> {         [ XF86MonBrightnessCycle ] };
    key <I252> {         [     bracketleft ] };
    key <I253> {         [       braceleft ] };
    key <I254> {         [        XF86WWAN ] };
    key <I255> {         [      XF86RFKill ] };

I can look into implementing this in the next days. I will try to add a configuration option which allows explicitly user-specified additional key codes to be overwritten. Would that be helpful?

@talenelat-elin
Copy link
Author

I only need a total of 20ish or so of these mappings, so that would indeed be helpful, thanks!

@svenlr
Copy link
Owner

svenlr commented Feb 21, 2023

Please take a look as this branch and see if that works for you:) As an example, I added two key_labels to the newly introduced setting "allow_repurpose_key_labels" in config.json just to show how it can be done. Please note that you should probably find other labels on your system to put there.

The new branch: https://github.com/svenlr/swift-map/tree/repurpose-used-key-labels

In order to find more key_labels to repurpose, you can look at your current xkb config:

xkbcomp $DISPLAY xkb.dump
cat xkb.dump  # or your favorite editor

Then scroll to the part that looks like the listing in my last comment.

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

No branches or pull requests

2 participants