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

3
  • 1
    Already answered here : superuser.com/questions/775785/… Jul 2, 2019 at 9:18
  • But if I disable keycodes won't it disable the numpad pg keys aswell? Jul 2, 2019 at 10:00
  • Possibly, yes. But if they have the same keycode, you won't be able to disable ones without the others. Unless, of course, you just remove them hardware-side. Jul 2, 2019 at 10:02

1 Answer 1

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

1
  • excellent answer! thank you
    – ilteris
    Feb 17 at 2:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .