4

I have a setup where I use the same (PC) keyboard for my PC and my Mac mini using a switch box. I switch back and forth between the two all the time - and in order to stay sane I have re-mapped many of the Mac shortcuts/keys using the Karabiner tool, so they function as they do on my PC (keys like Cut, Paste, Home, End, etc... ).

But I don't seem to be able to find a mapping in Karabiner that makes PgUp and PgDn work the same way on Mac as it does on PC. When I press PgUp / PgDn on Mac it scrolls the page, but don't seem to move the cursor. Funny enough - if I press ALT (Option) + PgUp and ALT + PgDn it does exactly what I want.

So basically, how do I get the PgUp to work as ALT + PgUp and PgDn to work as ALT + PgDn?

1
  • Isn't it possible to map PgUp to Option+PgUp in Karabiner? Sep 22, 2021 at 18:16

1 Answer 1

0

Here is some code that should work (I've got no PC keyboard):

{  "description": "page_up & page_down with cursor move",
       "manipulators": [
             {  "conditions": [ 
                { "bundle_identifiers":
                [ "^com.apple.TextEdit", "^com.any.other.app" ],
                  "type": "frontmost_application_if"
                                    } ]
             },
             {  "from": { "key_code": "page_up" },
                "to": [ { "shell_command": "osascript -e 'tell application \"System Events\" to key code 116 using option down'" } ],
                "type": "basic"
             },
             {  "from": { "key_code": "page_down" },
                "to": [ { "shell_command": "osascript -e 'tell application \"System Events\" to key code 121 using option down'" } ],
                "type": "basic"
             }
] }

I am not sure that the "conditions" manipulator is necessary with a PC keyboardºº (test it!).
IF IT IS you should add other text processing apps there (identifiable via Karabiner-EventViewer's Frontmost Application tab).

ºº(On my Apple keyboard "page_xx" otherwise no longer works with e.g. Safari.)

You must log in to answer this question.

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