Zuoya GMK67 Fn Row fix on Manjaro Linux
Shamal Lakshan

The problem

A common problem faced by GMK67 users when using Linux, is that the fn + 1 key combination which is supposed to produce the output f1 will produce a screen brightness decrease operation. And also, If you were to try and change the physical switch on the GMK67 to Mac mode it will fix the Fn row. But, it will alter the modifier keys. For example the Super / Win key will now become the Alt and the Alt will become the Super / Win key.

Solutions

After researching many solutions and multiple failures in solving this issue I was able to solve it. The post I initiallty used. Although the solution in the post itself didn’t work for me personally, one of the comments in the above post helped me solve this issue.

How I solved it.

  • Open the file /sys/module/hid_apple/parameters/fnmode in a text editor

  • Replace it’s value to 0s.

  • As mentioned in the post the above solution will fix this temporarily.

  • To make the change permanent do the following:

  • Open the file /etc/modprobe.d/hid_apple.conf in a text editor

  • Add / Edit this line

    Fold code block Copy code
    1
    options hid_apple fnmode=0
  • Add the hid_apple.conf to the configuration of mkinitcpio.

  • You can do it by opening /etc/mkinitcpio.conf in a text editor.

  • You’ll see a file like:

Fold code block Copy code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES=(usbhid xhci_hcd)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image. This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way. This is useful for config files.
FILES=(/etc/modprobe.d/hid_apple.conf)

# HOOKS
# This is the most important setting in this file. The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
## This setup specifies all modules in the MODULES setting above.
## No RAID, lvm2, or encrypted root is needed.
# HOOKS=(base)
#
## This setup will autodetect all modules for your system and should
## work as a sane default
# HOOKS=(base udev autodetect modconf block filesystems fsck)
#
## This setup will generate a 'full' image which supports most systems.
## No autodetection is done.
# HOOKS=(base udev modconf block filesystems fsck)
#
## This setup assembles a mdadm array with an encrypted root file system.
## Note: See 'mkinitcpio -H mdadm_udev' for more information on RAID devices.
# HOOKS=(base udev modconf keyboard keymap consolefont block mdadm_udev encrypt filesystems fsck)
#
## This setup loads an lvm2 volume group.
# HOOKS=(base udev modconf block lvm2 filesystems fsck)
#
## NOTE: If you have /usr on a separate partition, you MUST include the
# usr and fsck hooks.
HOOKS=(base udev autodetect kms modconf block keyboard keymap consolefont plymouth filesystems fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
#COMPRESSION="zstd"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

# MODULES_DECOMPRESS
# Decompress kernel modules during initramfs creation.
# Enable to speedup boot process, disable to save RAM
# during early userspace. Switch (yes/no).
#MODULES_DECOMPRESS="yes"

  • Add the location of the config file as in line 19 of the above code.

  • Then, rebuild the initramfs using:

    Fold code block Copy code
    1
    sudo mkinitcpio -p linux66
  • The above steps should help you in enabling you using your Fn row as usual when in Win mode of the GMK67 keyboard.

  • Thanks

For your Reference

  • GMK67 with Archlinux!

    Recently i bought a zuoya gmk67 keyboard, it doesn't have a function keys row and has a knob for volume control. Unfortunately, if you plug your gmk67 in a archlinux machine you will notice that using fn+1 will not produce f1 as expected, it will produce a screen brightness decrease, and if you change the physical switch in the back for the macOS mode, the function keys now work, but the modifier keys don't, quite stressful.

    Fear not, you can either alter your system configuration so the keyboard functions normally, as in this gist, or remap the keys, as seen in the gist Using GMK67 keyboard in linux with key remaps!.

    For this gist we are going to alter the configuration for the apple hid driver on archlinux, since this keyboard uses it, and alter the functionality of the Fn key.

    This is tested on archlinux, for any other distro you might have to figure out yourself the correponding commands!

    First write the following file as root:

    /etc/modprobe.d/hid_apple.conf:

    options hid_apple fnmode=2

    Then rebuild the initramfs:

    $ sudo mkinitcpio -p linux 
    

    And boom, know everything should work as intended, thanks @butterdori for the tip!. More info on the arch wiki:

    Apple Keyboard - Function keys do not work

    view raw gmk67_linux.md hosted with ❤ by GitHub
  • GMK67 with Linux!

    Recently i bought a zuoya gmk67 keyboard, it doesn't have a function keys row and has a know for volume control. Unfortunately, if you plug your gmk67 in a linux machine you will notice that using fn+1 will not produce f1 as expected, it will produce a screen brightness decrease, and if you change the physical switch in the back for the macOS mode, the function keys now work, but the modifier keys don't, quite stressful.

    Fear not, you can either remap the keys, as in this gist, or alter your system configuration so the keyboard functions normally, as seen in the gist Using GMK67 keyboard in linux. Function keys not working with Fn!.

    For this gist, we can simply remap some keys while the physical switch in the back is in windows mode. For that let's install keyd, a remapping tool daemon.

    Install

    For aarch linux use:

    $ yay -S keyd
    

    I know you are smart, you can figure how to install on other distros ;)

    Then start teh daemon:

    $ sudo systemctl enable --now keyd
    

    Config

    Create the following file:

    /etc/keyd/gmk67.conf:

    ###
    # GMK76 remap config file
    ###
    
    [ids]
    
    # all interface (BT, USB, 2.4Ghz dongle)
    k:05ac:024f
    
    [main]
    
    # Maps capslock to escape when pressed and control when held.
    # capslock = overload(control, esc)
    
    # Remaps the escape key to capslock
    #esc = capslock
    
    brightnessdown = f1
    brightnessup = f2
    scale = f3
    dashboard = f4
    kbdillumdown = f5
    kbdillumup = f6
    previoussong = f7
    playpause = f8
    nextsong = f9
    mute = f10
    volumedown = f11
    volumeup = f12
    
    # activates nav while held, but a tap is a normal capslock
    capslock = overload(nav, capslock)
    
    [nav]
    
    up = pageup
    down = pagedown
    left = home
    right = end
    
    [meta]
    
    mute = playpause
    volumedown = volumedown
    volumeup = volumeup

    Then run this command to load the config:

    $ sudo keyd reload
    

    And bam, it now works!

    Explanation

    This config works by remapping the multimedia events firectly into function keys, furthermore, while doing this the knob will stop working as it will produce function keys instead of the volume control we want, so we bind a key, meta, so teh know will emit volume control if we do meta+knob.

    In the top we also see a id section, this matches the physical vendor id of your device, in this case mine appears as 'Apple, Inc. Aluminium Keyboard (ANSI)'. You can check yours using:

    $ lsusb
    

    or by using keyd monitor and seeing the vendor id while typing something.

    $ sudo systemctl stop keyd
    $ sudo keyd monitor
    
    • If you dont want to do any of this, just change the id to *. This will match all keyboards in your machine

    As a bonus i remapped capslock to be used as a key modifier for the directional arrows and map them to pgup, pgdown, home and end respectively

    view raw gmk67_linux.md hosted with ❤ by GitHub