keyboard handling change

Dirk Hohndel dirk at hohndel.org
Tue Jan 1 10:38:25 PST 2013


This has been a pet peeve of Linus and mine since we switched to the
current screen layout with the three areas for divelist, profile and the
information notebook - if gtk's focus switched to one of the other two
areas of the window, cursor up/down would no longer switch to the
previous or next dive.

I just commited some code that grabs a few keys away from gtk whenever
the main window has the focus. It uses Cursor up/down to switch dives
and right/left to switch between divecomputers (if you have multiple
computers for a dive... has anyone besides Linus and me ever tried that?
The existing key binding of Ctrl-C was just retarded...).

In the current UI design where all editing happens in separate windows
this works as expected, as we only grab the keys for the main window. If
we manage to re-enable in-place editing then we need to make sure that
this doesn't cause problems (as gtk uses up/down for the ability to
change drop down selections in combo boxes or values in spin buttons and
of course you need left/right to edit test). So we must make sure that
we stop stealing these keys once we start editing something (in which
case simply switching to the next/prev dive wouldn't be a good thing,
anyway).

Please give it a try and see if you can break it.

/D
 


More information about the subsurface mailing list