Mapping Ctrl+Arrow for Home/End/PageUp/Down

10,181

Solution 1

Sure, but you'll need to use a third party program such as AutoHotkey. For example if you wanted to map Ctrl + Up up to pg up and Ctrl + down to Pg Dn you would write:

^{Up}::{PgUp}
^{Down}::{PgDown}

in your AHK file. See the Remap Reference.

I've come to understand that recent versions no longer recognize this, It seems page Up and down have been changed. Try this if the above does not work:

^Up::PgUp
^Down::PgDn

Make sure you run as administrator in Windows Vista/7/8

Solution 2

The script in the accepted answered does not work (AHK rejects it as invalid), so I went to the #AHK IRC channel and they told me that it should be:

^Up::PgUp
^Down::PgDn

So, no squigly brackets, and PgDn or PageDown, but not PgDown.

Or, some people seem to need:

^Up::Send {PgUp}
^Down::Send {PgDn}

This works me for (Windows Vista, AHK 1.1.13.01)

Solution 3

The AutoHotkey's documentation says (v. 1.1.28.02):

Return will become your best friend. It literally STOPS code from going any further, to the lines below. This will prevent many issues when you start having a lot of stuff in your scripts.

So the whole script should look like:

^Up::
    Send, {PgUp}
return
^Down::
    Send, {PgDn}
return

I would like to suggest also addition another two hotkeys (even if you already have Home & End buttons on your keyboard):

^Left::
    Send, {Home}
return
^Right::
    Send, {End}
return

In my opinion, it's better to use an Alt key instead of Ctrl for that purpose. Because many programs could has own implementation of Ctrl+PgUp/PgDn shortcut.

Share:
10,181

Related videos on Youtube

user67275
Author by

user67275

Updated on September 18, 2022

Comments

  • user67275
    user67275 over 1 year

    I'm using Windows 7 on Dell New Inspiron 14z Ultrabook. It doesn't have Home/End/PgUp/PgDn keys. Instead I have to use Fn + arrow keys.

    Can I re-map those to Ctrl + arrows or Alt + arrows or Shift + arrows?

    That way I could go one page up and down with only my right hands rather than with the left hand on the Fn key and right hand on arrow key.

    Also, volume up and down is assigned to FnF11 and FnF12. Can I re-map them to F11 and F12? Existing functions assigned to F11 and F12 will be replaced by FnF11 and FnF12.

    Is it possible?

    • Tom
      Tom over 10 years
      The accepted answer pointed me in the right direction, but its syntax is not valid - see my answer for the correct syntax.
  • techturtle
    techturtle over 11 years
    ^{Down} is Ctrl+Down, not Fn+Down. Typo?
  • Rhys
    Rhys over 11 years
    No, the OP wanted to map Ctrl + down to PgDn.
  • techturtle
    techturtle over 11 years
    Yes, but your answer said it was Fn+Down. Jared Tritsch edited it to correct.
  • user67275
    user67275 over 11 years
    because I think ctrl or alt + arrows might have their own function in Windows or other applications. So I leave them for LEFT ctrl or alt and use RIGHT ctrl or alt for my own hot key.
  • Tom
    Tom over 10 years
    The above example doesn't work for me. It says that "^{Up}::{PgUp}" is an invalid hotkey. I'm using Win Vista.
  • JochenJung
    JochenJung almost 10 years
    Same for me on Win 7. "^{Up}::{PgUp}" is an invalid hotkey.
  • Rhys
    Rhys almost 10 years
    @JochenJung I have updated this post for more recent editions of Windows.