hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
20.87k stars 876 forks source link

Keyboard not working correctly - v0.34.0-31 #4404

Open EliteAMDGamer opened 9 months ago

EliteAMDGamer commented 9 months ago

Hyprland Version

System/Version info ```sh ```

Bug or Regression?

Bug

Description

I have a issue with my keyboard on hyprland. works fine in kde garuda. I currently cant use underscores well - = keys well any of the non number symbol keys. caps lock also wont work for a brief moment when changing to a 104 key generic layout which matched kde it worked then stopped working after a few moments. an hasn't since even after a reinstall. The other main problem is hitting shift or moving the mouse about randomly triggers num lock on an off i have a slightly unique numpad/arrow pad with the Cooler Master Quick Fire TK but its never had issue in other places. I should add that i can do shortcuts normally even if shift is used. -Numlock committed in or out makes no difference.

# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = us
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =
    #numlock_by_default= false
    follow_mouse = 1

touchpad {
    natural_scroll = true
    tap-to-click = true
    disable_while_typing = true

How to reproduce

The only way I would say is if you have this keyboard type anywhere you can an try to do a underscore or any of the symbol keys such as double quotes.

Crash reports, logs, images, videos

No response

hholst80 commented 9 months ago

I am not a Hyprland developer but I have fiddled a bit with unusual keyboards in Linux.

Does the keys work as expected in console outside Hyprland?

Try the showkey command and see if the keys and shift modifiers work as expected in console.

SHOWKEY(1)                                                                                                General Commands Manual                                                                                               SHOWKEY(1)

NAME
       showkey - examine the codes sent by the keyboard

SYNOPSIS
       showkey [-h|--help] [-a|--ascii] [-s|--scancodes] [-k|--keycodes] [-V|--version]

DESCRIPTION
       showkey  prints  to standard output either the scan codes or the keycode or the ‘ascii' code of each key pressed.  In the first two modes the program runs until 10 seconds have elapsed since the last key press or release event,
       or until it receives a suitable signal, like SIGTERM, from another process.  In ‘ascii' mode the program terminates when the user types ^D.

       When in scancode dump mode, showkey prints in hexadecimal format each byte received from the keyboard to the standard output. A new line is printed when an interval of about 0.1 seconds occurs between  the  bytes  received,  or
       when  the internal receive buffer fills up. This can be used to determine roughly, what byte sequences the keyboard sends at once on a given key press. The scan code dumping mode is primarily intended for debugging the keyboard
       driver or other low level interfaces. As such it shouldn't be of much interest to the regular end-user. However, some modern keyboards have keys or buttons that produce scancodes to which the kernel does not  associate  a  key‐
       code, and, after finding out what these are, the user can assign keycodes with setkeycodes(8).

       When  in  the default keycode dump mode, showkey prints to the standard output the keycode number or each key pressed or released. The kind of the event, press or release, is also reported.  Keycodes are numbers assigned by the
       kernel to each individual physical key. Every key has always only one associated keycode number, whether the keyboard sends single or multiple scan codes when pressing it. Using showkey in this mode, you can find out what  num‐
       bers to use in your personalized keymap files.

       When in ‘ascii' dump mode, showkey prints to the standard output the decimal, octal, and hexadecimal value(s) of the key pressed, according to he present keymap.

OPTIONS
       -h --help
              showkey prints to the standard error output its version number, a compile option and a short usage message, then exits.

       -s --scancodes
              Starts showkey in scan code dump mode.

       -k --keycodes
              Starts showkey in keycode dump mode. This is the default, when no command line options are present.

       -a --ascii
              Starts showkey in ‘ascii' dump mode.

       -V --version
              showkey prints version number and exits.

2.6 KERNELS
       In  2.6  kernels  key codes lie in the range 1-255, instead of 1-127.  Key codes larger than 127 are returned as three bytes of which the low order 7 bits are: zero, bits 13-7, and bits 6-0 of the key code.  The high order bits
       are: 0/1 for make/break, 1, 1.

       In 2.6 kernels raw mode, or scancode mode, is not very raw at all.  Scan codes are first translated to key codes, and when scancodes are desired, the key codes are translated back.  Various  transformations  are  involved,  and
       there is no guarantee at all that the final result corresponds to what the keyboard hardware did send. So, if you want to know the scan codes sent by various keys it is better to boot a 2.4 kernel. Since 2.6.9 there also is the
       boot option atkbd.softraw=0 that tells the 2.6 kernel to return the actual scan codes.

SEE ALSO
       loadkeys(1), dumpkeys(1), keymaps(5), setkeycodes(8)

kbd                                                                                                             1 Feb 1998                                                                                                      SHOWKEY(1)
EliteAMDGamer commented 9 months ago

I am not a Hyprland developer but I have fiddled a bit with unusual keyboards in Linux.

Does the keys work as expected in console outside Hyprland?

Try the showkey command and see if the keys and shift modifiers work as expected in console.

SHOWKEY(1)                                                                                                General Commands Manual                                                                                               SHOWKEY(1)

NAME
       showkey - examine the codes sent by the keyboard

SYNOPSIS
       showkey [-h|--help] [-a|--ascii] [-s|--scancodes] [-k|--keycodes] [-V|--version]

DESCRIPTION
       showkey  prints  to standard output either the scan codes or the keycode or the ‘ascii' code of each key pressed.  In the first two modes the program runs until 10 seconds have elapsed since the last key press or release event,
       or until it receives a suitable signal, like SIGTERM, from another process.  In ‘ascii' mode the program terminates when the user types ^D.

       When in scancode dump mode, showkey prints in hexadecimal format each byte received from the keyboard to the standard output. A new line is printed when an interval of about 0.1 seconds occurs between  the  bytes  received,  or
       when  the internal receive buffer fills up. This can be used to determine roughly, what byte sequences the keyboard sends at once on a given key press. The scan code dumping mode is primarily intended for debugging the keyboard
       driver or other low level interfaces. As such it shouldn't be of much interest to the regular end-user. However, some modern keyboards have keys or buttons that produce scancodes to which the kernel does not  associate  a  key‐
       code, and, after finding out what these are, the user can assign keycodes with setkeycodes(8).

       When  in  the default keycode dump mode, showkey prints to the standard output the keycode number or each key pressed or released. The kind of the event, press or release, is also reported.  Keycodes are numbers assigned by the
       kernel to each individual physical key. Every key has always only one associated keycode number, whether the keyboard sends single or multiple scan codes when pressing it. Using showkey in this mode, you can find out what  num‐
       bers to use in your personalized keymap files.

       When in ‘ascii' dump mode, showkey prints to the standard output the decimal, octal, and hexadecimal value(s) of the key pressed, according to he present keymap.

OPTIONS
       -h --help
              showkey prints to the standard error output its version number, a compile option and a short usage message, then exits.

       -s --scancodes
              Starts showkey in scan code dump mode.

       -k --keycodes
              Starts showkey in keycode dump mode. This is the default, when no command line options are present.

       -a --ascii
              Starts showkey in ‘ascii' dump mode.

       -V --version
              showkey prints version number and exits.

2.6 KERNELS
       In  2.6  kernels  key codes lie in the range 1-255, instead of 1-127.  Key codes larger than 127 are returned as three bytes of which the low order 7 bits are: zero, bits 13-7, and bits 6-0 of the key code.  The high order bits
       are: 0/1 for make/break, 1, 1.

       In 2.6 kernels raw mode, or scancode mode, is not very raw at all.  Scan codes are first translated to key codes, and when scancodes are desired, the key codes are translated back.  Various  transformations  are  involved,  and
       there is no guarantee at all that the final result corresponds to what the keyboard hardware did send. So, if you want to know the scan codes sent by various keys it is better to boot a 2.4 kernel. Since 2.6.9 there also is the
       boot option atkbd.softraw=0 that tells the 2.6 kernel to return the actual scan codes.

SEE ALSO
       loadkeys(1), dumpkeys(1), keymaps(5), setkeycodes(8)

kbd                                                                                                             1 Feb 1998                                                                                                      SHOWKEY(1)

After testing it seems as if its not registering shift at least correctly. I'm not really sure how but guess I would have to make my own layout or something.

kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
keycode  28 release
-keycode  42 press
keycode  12 press
keycode  42 release
keycode  12 release
keycode  42 press
=keycode  13 press
keycode  13 release
keycode  42 release
keycode  42 press
'keycode  40 press
keycode  42 release
keycode  40 release
keycode  42 press
/keycode  53 press
keycode  42 release
keycode  53 release
keycode  42 press
.keycode  52 press
keycode  52 release
keycode  42 press
keycode  42 press
keycode  42 release
keycode  29 press
keycode  32 press
keycode  32 release
keycode  29 release
keycode  42 press
Akeycode  30 press
keycode  30 release
keycode  42 release
akeycode  30 press
keycode  30 release
keycode  42 press
$keycode   5 press
keycode   5 release
keycode  42 release
4keycode   5 press
keycode   5 release

-

[elite@elite-hyperland ~]$ sudo showkey -s
kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
0x9c 
0x2a 
-0x0c 0x8c 0x2a 0x2a 0xaa 
0x2a 
=0x0d 0x8d 0x2a 0x2a 0x2a 0xaa 
0x2a 
/0x35 0xb5 0x2a 0x2a 0x2a 0xaa 

-

[elite@elite-hyperland ~]$ sudo showkey -a

Press any keys - Ctrl-D will terminate this program

-   45 0055 0x2d
=   61 0075 0x3d
/   47 0057 0x2f
A   65 0101 0x41
a   97 0141 0x61
$   36 0044 0x24
4   52 0064 0x34
-   45 0055 0x2d
-   45 0055 0x2d