Forum: Ruby-Gnome 2 ScrolledWindow - how to enable scrolling with page up and page down keys?

4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (shevegen)
on 2013-12-10 19:30

I have a Scrolled Window. The mouse keys work fine, I can scroll up and
down, but not with page up and page down.

Does someone understand why page up and page down does not work or more
importantly how to enable this?

  scrolled_window =

When I am with my cursor inside such a scrolled window, the page up and
page down keys don't seem to make anything.
D9ba13de4e62fcabffa4403731434e42?d=identicon&s=25 Eric C. (eric_c65)
on 2013-12-11 08:30
You could try the key_press event or button_release_event.  Look in the
docs.  Add this line inside the method:

puts "Key number: " + key.to_s

When the program runs, press the pageup key and look at the number.

Then write in your code:

if key == (number)
  <code to make page up..>

Hope this helps.

If you're using visualruby, you could just add the method:

scrolledwindow1_key_press(me, key)
  if key.keyval == 65365 #PgUp

  else if key.keyval == 65366 #PgDn


Give that a shot.

Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.