SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-09-04 03:04:28

alloydwhitlock
New Member
From: Stoughton, WI - United States
Registered: 2011-09-03
Posts: 7
Website

Creating a Page-Up & Page-Down Key Combo (Solved - Workaround)

My laptop does not physically have a Page-Up or Page-Down key on it (Google "Chromebook" Cr-48). It's annoying when trying to use a terminal or browse through web pages when paging through would be nice. I'm familiar with remapping keys with xmodmap and using the rc.xml file for key combinations in Openbox, but I don't know how to create a key command for a key that doesn't exist using the rc.xml file.

What I want to do is when I hit Ctrl-Alt-Up it would do a Page-Up command and Ctrl-Alt-Down would do a Page-Down command. Maybe I'm overthinking this, but I've looked around and couldn't find any way of doing this.

Any help with this would be great.

Last edited by alloydwhitlock (2011-09-05 15:53:46)


Cr-48 + CrunchBang = Awesomeness

Offline

Be excellent to each other!

#2 2011-09-04 03:11:54

thevdude
#! Junkie
From: Pittsburgh, PA
Registered: 2011-09-01
Posts: 469

Re: Creating a Page-Up & Page-Down Key Combo (Solved - Workaround)

Gah, I was just reading about moving keys. xev shows the keyname for page up and page down as "Prior" and "Next". Let me do a bit of googling.

What about Shift+Up and Shift+Down? It doesn't seem like there's a way to do it with just what's installed on #! for Ctrl + Alt + Up, but on my system at least, Shift + Up and Shift + Down don't do anything. What you'll want to do is open terminal and do:

xmodmap -pke

and scroll through to find Up and Down, mine were here

keycode 111 = Up NoSymbol Up
keycode 112 = Prior NoSymbol Prior
keycode 113 = Left NoSymbol Left
keycode 114 = Right NoSymbol Right
keycode 115 = End NoSymbol End
keycode 116 = Down NoSymbol Down
keycode 117 = Next NoSymbol Next

If I were to do

xmodmap -e 'keycode 111 = Up Prior Up'
xmodmap -e 'keycode 116 = Down Next Down'

that would set Shift + Up to page up, and Shift + Down to page down.

Works fine for everything except chromium, for some reason. D: Will look into it.

Last edited by thevdude (2011-09-04 03:58:54)

Offline

#3 2011-09-04 04:03:06

alloydwhitlock
New Member
From: Stoughton, WI - United States
Registered: 2011-09-03
Posts: 7
Website

Re: Creating a Page-Up & Page-Down Key Combo (Solved - Workaround)

After some digging it appears that xmodmap won't necessarily let you do a combo to initiate the key, since whatever key you are using will bring you into the next "layer" in xmodmap. Shift will have to do!

I just tried your last update and it is working in terminator, but obviously not in Chromium. That's odd. Something else I just noticed is that depending on the application (e.g., LibreOffice Writer) that the shift key still retains its original value and highlights the text as you go up or down. Other applications, like terminator or gedit, do not do this.

Thanks so much for your help thevdude! Hopefully we, and maybe someone else too, can figure this out.

Last edited by alloydwhitlock (2011-09-04 04:32:19)


Cr-48 + CrunchBang = Awesomeness

Offline

#4 2011-09-04 12:29:55

thevdude
#! Junkie
From: Pittsburgh, PA
Registered: 2011-09-01
Posts: 469

Re: Creating a Page-Up & Page-Down Key Combo (Solved - Workaround)

There's a Fourth Column you can add that's supposed to make it SHIFT + ALT + [KEY]. I'll try that out. IDK, didn't work for me.

You'll want to add this line to your autostart.sh, because when you log out it'll change back.

(xmodmap -e 'keycode 111 = Up Prior Up' && xmodmap -e 'keycode 116 = Down Next Down') &

it doesn't work in chromium because of this. Increment/Decrement Value by 10. The third column is supposed to be with ALT, so try 'Up NoSymbol Prior' and hitting alt (or altgr) and up. I'm not by my netbook, so I can't try.

Last edited by thevdude (2011-09-04 13:48:51)

Offline

#5 2011-09-04 16:10:02

alloydwhitlock
New Member
From: Stoughton, WI - United States
Registered: 2011-09-03
Posts: 7
Website

Re: Creating a Page-Up & Page-Down Key Combo (Solved - Workaround)

I installed a tool named "xdotool" onto my system with the following command:

sudo apt-get install xdotool

Afterward, I edited the rc.xml file in ~/.config/openbox/rc.xml and added the following:

   
 <keybind key="C-A-Up">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Page Up</name>
        </startupnotify>
        <command>xdotool key --clearmodifiers Page_Up</command>
      </action>
    </keybind>
    <keybind key="C-A-Down">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Page Down</name>
        </startupnotify>
        <command>xdotool key --clearmodifiers Page_Down</command>
      </action>
    </keybind>

It's important to make sure that there are no other keybind actions present for "C-A-Up" or "C-A-Down" or else there might be a conflict and things won't work as expected.

This isn't the best solution, but it does appear to work like it should. Text is not highlighted when the command is run and it works in Chromium.

Thoughts? Comments?

Edit: I noticed that my CPU usage for xorg obviously jumps when I use this command. Considerably.

Last edited by alloydwhitlock (2011-09-04 16:40:46)


Cr-48 + CrunchBang = Awesomeness

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo