1

I have a Lenovo E590 as a company laptop. After using it for a while I really got annoyed by the placement of the PgUp and PgDn keys of it. They are located directly above the left and right arrows and while editing text or editing commands I often hit them instead of left or right. This is a really bad design in my opinion and annoys especially when working on a shell.

Is there a way under Linux to have these buttons turned off permanently? For the rare cases where I need PgUp/PgDn I'd rather turn off Num and use the keys there instead.

https://www.notebookcheck.com/fileadmin/processed/d/8/csm_DSC_0001_17c120cf17.jpg

1 Answers1

1

If you use GNOME, the following approach adds an option in the GNOME Tweak Tool.

Create /usr/share/X11/xkb/symbols/custom with the contents

partial modifier_keys
xkb_symbols "pgupdn_disabled" {
    key <PGUP> {[ VoidSymbol ]};
    key <PGDN> {[ VoidSymbol ]};
};

In /usr/share/X11/xkb/rules/evdev, find the line ! option = symbols and add the following line:

  custom:pgupdn_disabled = +custom(pgupdn_disabled)

In /usr/share/X11/xkb/rules/evdev.xml, add the following in the bottom just before </optionList>:

    <group allowMultipleSelection="false">
      <configItem>
        <name>pgupdn</name>
        <description>Page Up and Page Down behavior</description>
      </configItem>
      <option>
        <configItem>
          <name>custom:pgupdn_disabled</name>
          <description>Disable Page Up and Page Down</description>
       </configItem>
      </option>
    </group>

Now if you open GNOME Tweak Tool, you should see the following option under "Keyboard & Mouse" -> "Additional Layout Options".

If the option appears in Tweak Tool, but it doesn't seem to do anything, then I recommend watching the output of journalctl -f while you toggle the option on and off - syntax errors might prevent proper function, and they will be reported in the journal.

GNOME Tweak Tool with the new "Disable Page Up and Page Down" option

Mathias Rav
  • 291
  • 2
  • 5