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

Exchanging two keys in keyboard layout #4397

Closed
mielouk opened this issue Jul 29, 2019 · 4 comments
Closed

Exchanging two keys in keyboard layout #4397

mielouk opened this issue Jul 29, 2019 · 4 comments

Comments

@mielouk
Copy link

mielouk commented Jul 29, 2019

swaymsg -t get_version
sway version 1.0

To be able to type in Dutch more easily with the de(bone) layout, I need to switch J and Q in the layout, as I've learned here from @RedSoxFan

Till now this is what I got, which reverts me to QWERTY and I'm not sure how to progress or what I did wrong.

@emersion
Copy link
Member

(Closing because this isn't a sway bug.)

@mielouk
Copy link
Author

mielouk commented Jul 29, 2019

Where should I put it then?

@RedSoxFan
Copy link
Member

If it's reverting to QWERTY, then your custom layout either cannot be found or is invalid. If you are running sway master, swaynag should show the first line of the error. For 1.1.1 or the full error message, look at a debug log. FWIW, the layout you linked works for me so I would check the location you have it saved to

Either way, as emersion pointed out this isn't a sway bug. #sway on irc.freenode.net would be a better location for this sort of discussion.

@mielouk
Copy link
Author

mielouk commented Jul 30, 2019

Due to the help from @progandy I found my user error.

The new partial layout in ~/.xkb/symbols/de-bone-j-q looks like this:

default partial alphanumeric_keys
xkb_symbols "basic" {
  include "de(bone)"
	name [Group1] = "BoneJQ";
	key <AD01> { [ q, Q, at, U03D5, Prior, Prior, U211A ] };
	key <AC11> { [ j, J, ellipsis, Greek_theta, period, KP_Decimal, Greek_THETA ] };
};

To find the right content for the brackets I used xmodmap -pke, deleted the first doubled entries and separated the rest with commas. The 5th and 6th positions were exchanged to keep the functionality.

In /usr/share/X11/xkb/keycodes/evdev it is possible to find the keycode corresponding with the keypos (AD, AC, ....)

This layout is now called upon in the sway config via:

input type:keyboard xkb_layout "de-bone-j-q"
input * xkb_variant ""
input "DasKeyboard" xkb_model "pc105"

Note the empty variant and that there is only one layout! (My bad, thx again @progandy )

The sway wiki to change the layout like with xmodmap points towards the bug report answered by @RedSoxFan . If I would've used the IRC nobody could find this explanation.

Thx to everybody involved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants