Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use a MacBook pro and am using Linux Mint. I know this is an Ubuntu forum but Mint is built on top of Ubuntu so I am trying here.

The Macbook Pro doesn't have a Page Down or Page Up button. Applications such as Epiphany and Terminal use these buttons to switch between tabs. Ubuntu and Mint both use APT so I assume all applications are the same if not extremely similar. You cannot re-key-bind the terminal nor Epiphany. So I tried the Keyboard settings app and Keyboard Layout app to see if I could change the keys. This proved futile.

What I want is either to rebind the keys in Epiphany and the Terminal, or bind Page up and Page down to something else.

share|improve this question
add comment

3 Answers 3

up vote 3 down vote accepted

I use a macbook air and the fn+up and fn+down keys provide page up and page down functionality.

Alternatively, you can map additional keys to the page up and down functions, i.e. the right command and alt/option keys (honestly, how often do you use them?) Some info on this can be found here:

https://wiki.archlinux.org/index.php/Xmodmap

The short version is to use the xev program to determine what the key codes you want to change are, and create a program (say, ~/.Xmodmap) with information that remaps the key. I use this to swap my capslock and delete keys using:

keycode 0x16 = Delete keycode 0x42 = Backspace

Then add the command "xmodmap ~/.Xmodmap" to either your ~/.profile or ~/.bashrc files, and then run the command xmodmap ~/.Xmodmap from terminal, and your changes should take effect.

share|improve this answer
add comment

You can press Ctrl + fn + up/down

share|improve this answer
add comment

I assume this same process will work for Ctrl as it did with Alt for me. Just be careful when testing the keys you assign using xbindkeys-config.

I read this https://help.ubuntu.com/community/KeyboardShortcuts which helped me figure out the following. While the xautomation package that includes the xte tool might be used instead of xvkbd to emit the key codes I used xvkbd to do the same thing.

sudo apt-get install xbindkeys xbindkeys-config xvkbd

xbindkeys --defaults > /home/your-user-name/.xbindkeysrc

For some reason this added a binding for ctrl-f that I had to comment out. While perhaps a useful default example I need ctrl-f to find inside of web pages.

After figuring out the "keysims" of Prior for PgUp and Next for PgDown this wasn't too tough. Running and using xbindkeys-config resulted in the following entries in .xbindkeysrc for me.

#alt-up
"xvkbd -xsendevent -text "\[Prior]""
    m:0x18 + c:111
    Alt+Mod2 + Up

#alt-down
"xvkbd -xsendevent -text "\[Next]""
    m:0x18 + c:116
    Alt+Mod2 + Down

when using Ubuntu 12.04 precise pangolin after creating the .xbindkeysrc file it was detected and the xbindkeys program was run automatically on my next login.

So this should do what you want.

#ctrl-up
"xvkbd -xsendevent -text "\[Prior]""
    m:0x14 + c:111
    Ctrl+Mod2 + Up

#ctrl-down
"xvkbd -xsendevent -text "\[Next]""
    m:0x14 + c:116
    Ctrl+Mod2 + Down
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.