3

By default I have to hit fn+up arrow and fn+down arrow for page up and page down actions, but those buttons are on opposite sides of the keyboard. I want to be able to do rshift+up and rshift+down.

I already tried System Preferences -> Keyboard -> Shortcuts -> App Shortcuts, but it only lets me map to menu items.

  • It wouldn't be it App Shortcuts; those shortcuts are system wide. – haykam May 20 '16 at 21:26
1

You can set system-wide keybindings via the ~/Library/Keybindings/DefaultKeyBinding.dict file (more info) however it doesn't appear to be possible to distinguish between the left and right shift keys, so I think what you want to achieve is not possible.

  • Perfect, thanks! For my needs it's OK if left shift gets bound too. – Seán Hayes May 23 '16 at 22:58
  • Actually, I found this doesn't always work, it only works if the app implements a specific Cocoa protocol. – Seán Hayes May 24 '16 at 0:05
0

I was able to do what I wanted by installing Karabiner and adding a file here:

$ nano ~/Library/Application\ Support/Karabiner/private.xml

I added the following:

<?xml version="1.0"?>
<root>

  <item>
    <name>Custom Shortcuts</name>
    <item>
      <name>Shift + Up = Page Up</name>
      <identifier>custom.pageup</identifier>
      <autogen>__KeyToKey__ KeyCode::CURSOR_UP, VK_SHIFT | ModifierFlag::NONE, KeyCode::PAGEUP</autogen>
    </item>
    <item>
      <name>Shift + Down = Page Down</name>
      <identifier>custom.pagedown</identifier>
      <autogen>__KeyToKey__ KeyCode::CURSOR_DOWN, VK_SHIFT | ModifierFlag::NONE, KeyCode::PAGEDOWN</autogen>
    </item>
    <item>
      <name>Shift + Left = Home</name>
      <identifier>custom.home</identifier>
      <autogen>__KeyToKey__ KeyCode::CURSOR_LEFT, VK_SHIFT | ModifierFlag::NONE, KeyCode::HOME</autogen>
    </item>
    <item>
      <name>Shift + Right = End</name>
      <identifier>custom.end</identifier>
      <autogen>__KeyToKey__ KeyCode::CURSOR_RIGHT, VK_SHIFT | ModifierFlag::NONE, KeyCode::END</autogen>
    </item>
    <item>
      <name>Shift + Delete = Forward Delete</name>
      <identifier>custom.delete</identifier>
      <autogen>__KeyToKey__ KeyCode::DELETE, VK_SHIFT | ModifierFlag::NONE, KeyCode::FORWARD_DELETE</autogen>
    </item>
  </item>
</root>

I then clicked "Reload XML" in Karabiner and selected the new options, which took effect immediately! It seems to simulate the desired keypresses in every app.

  • I switched boastr.net since Karabiner doesn't work with MacOS 10.12 Sierra. – Seán Hayes Sep 28 '16 at 2:16

You must log in to answer this question.

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