Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Keys not work on another layout #379

Closed
neuromagus opened this issue Jan 26, 2023 · 18 comments
Closed

Keys not work on another layout #379

neuromagus opened this issue Jan 26, 2023 · 18 comments
Labels
A: bug Something isn't working

Comments

@neuromagus
Copy link

Info

dwl version: 0.4 (git)
wlroots version: latest

If I change layout, all keys with LOGO/ALT not work.
Need add keycode or some mechanism.

P.S. SwayWM and RiverWM have a solution and options in config.

@neuromagus neuromagus added the A: bug Something isn't working label Jan 26, 2023
@krypciak
Copy link
Contributor

What do you mean by a layout? A keyboard layout? Tiling layout (floating, monocle, etc.)?
By all keys you mean keybindings?
Can tell us more about the solution used in Sway/River?

@neuromagus
Copy link
Author

neuromagus commented Jan 26, 2023

'ru', 'es', 'fra' etc... Language (not 'us'). Need some univesal keycodes for keys. Or in another Layout u dont change a workspace.

By all keys you mean keybindings?

Yes.

A keyboard layout?

Yes.

@neuromagus
Copy link
Author

neuromagus commented Jan 26, 2023

Can tell us more about the solution used in Sway/River?

bindsym --to-code in Sway

Freud in RiverWM create hack... Here: riverwm/river#753 or not... I forgot (I create issue in RiverWM too and guys fix this behavior ;)) But not found today.

And I use custom Dvorak for US and Custom Russian Typewriter for RU. Default location of keys did not match... (QWERTY etc)

@krypciak
Copy link
Contributor

krypciak commented Jan 26, 2023

I have made a hack that switches the keyboard layout to qwerty us when a mod key is pressed (except shift). After it's released, it goes back to the previous layout.
You can also set a keybining to switch the layout. Would you like a patch for that?
This also makes stuff like CTRL+C and CTRL+V work for other apps

@neuromagus
Copy link
Author

neuromagus commented Jan 26, 2023

Thanks for fast answer and trying fix this problem.

nope... I dont use copy/paste in keys ;). I use select/middle button of mouse.
I use patched version of xkb (I create personal layout for programming).

And my accords or macros did not work (I think).

So, I think, need complex solution of any languages and custom keybindings. All people different. Freud in RiverWM create Array of every keys and keycodes... But in WLROOTS 16 maybe add something, I dont know (Freud committer in WLROOTS).

Most my coworker and friends uses another layouts (Colemac, Workman, Neo etc) and use 2-3 languages (and special symbols UTF-8: Š, Ü, ß)...

@krypciak
Copy link
Contributor

Any keyboard layout with any language would work. It doesn't matter that you have a custom keyboard layout.
Example:

Your default keyboard layout is dvorak
Press CTRL, keyboard layout changes to qwerty (or any of your choise)
Press F, The client goes fullscreen
Release F and CTRL
Keyboard layout goes back to dvorak (or any of your choise)

In this case only 1 keybinding definition is needed, and will work for all layouts.

That workes for me, and I don't see any reson why it wouldn't work for you.

@neuromagus
Copy link
Author

neuromagus commented Jan 26, 2023

))) Why not? Let's try )) But... my CTRL in another place ;) I use Emacs and I crack my HHKB to 40% keyboard with layers (hello, 'Neo' - https://neo-layout.org). So... All my keys changed. ALT, CAPS, ESC, CTRL, LOGO(WIN) - all this keys are rebinded.

For example (Space Cadet - Emacs default https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Space-cadet.jpg/1920px-Space-cadet.jpg)
CTRL -> ALT
ALT -> LWIN
CAPS -> ESC
RALT -> Layer1
RWIN -> LWIN (LOGO)

@krypciak
Copy link
Contributor

krypciak commented Jan 26, 2023

What the hell. It is possible to do this. You would first need to pick a keyboard layout and write your keybindings for it. What keyboard layouts do you use? How different are they form each other?

@neuromagus
Copy link
Author

neuromagus commented Jan 26, 2023

How different are they form each other?

Yep ;))) Totally different. For example, this ver 0.001. Later I change all special keys and some layers...
version1-0

And my improved Dvorak works well on River and Sway. But I prefer DWM (Xmonad). Wayland come... RHEL 9 use Wayland default (and FF native), Debian BookWorm - Wayland default...

@krypciak
Copy link
Contributor

Is this the only keyboard layout you use?

@neuromagus
Copy link
Author

neuromagus commented Jan 26, 2023

US, RU. And yes.

Another WM works fine.

@krypciak
Copy link
Contributor

Alright, so I assume that both layouts you use share the same mod key placements. All you need to do is make keybindings that work for the US layout,
and I'll prepare a patch that allows you to switch between the layouts and keep the US keybindings for a RU layout.

@neuromagus
Copy link
Author

Alright, so I assume that both layouts you use share the same mod key placements. All you need to do is make keybindings that work for the US layout,
and I'll prepare a patch that allows you to switch between the layouts and keep the US keybindings for a RU layout.

Ohoh... Sorry for that, but... If DWL later change DWM - u take a fat user base (DB). And maybe need fix this on keycodes, not listen symbols?
This is my config of keyboard
inkl.tar.gz

@krypciak
Copy link
Contributor

Actually, I'm dumb. Take a look at this patch: https://github.com/djpohly/dwl/wiki/keycodes.
It might just do what you want all along.

@neuromagus
Copy link
Author

neuromagus commented Jan 26, 2023

holy!.. Wow, thanks. Actually - 'dumb' - its me. I use 3 patches and not see this... Crap. Thanks, after testing I close this issue.

I read patch, keysum changed on keycode in dwl.c. Thats enough for me.

Best regards, Krypciak.

@neuromagus
Copy link
Author

Ah, and my Eng is terrible, so please, add link on this patch (or say to merge this patch in master branch in Discord) in README, Wiki (key section) or somewhere in documentation.

@neuromagus
Copy link
Author

neuromagus commented Feb 27, 2023

I try patch https://github.com/djpohly/dwl/wiki/keycodes. Not working properly.
In keys.h codes added only for QWERTY layout. In Dvorak all keys are drop. (or need rewrite keys.h, but how to be in Colemac or another layout?)

IMO, need something for all keymaps (maybe use xkb, without any external hacks?)

@neuromagus neuromagus reopened this Feb 27, 2023
@sevz17
Copy link
Collaborator

sevz17 commented Mar 19, 2023

I try patch https://github.com/djpohly/dwl/wiki/keycodes. Not working properly. In keys.h codes added only for QWERTY layout. In Dvorak all keys are drop. (or need rewrite keys.h, but how to be in Colemac or another layout?)

keys.h is only a helper, even if you use another layout (and/or variant), you can use it as reference for your keybindings.

IMO, need something for all keymaps (maybe use xkb, without any external hacks?)

I just updated the patch, I included the program I used to generate keys.h

@sevz17 sevz17 closed this as completed Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants