From 7cec9a0cb0f40be3cac9b92f973c04d248a2f02b Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 5 Sep 2006 12:46:57 +0100 Subject: [PATCH] * Improve keyboard navigation in accessibility menu: 0 selects None, and 1, 2, etc. select other menu items in order (closes: Malone #39303). --- debian/changelog | 2 ++ dia_access.inc | 17 +++++++++++++++++ window.inc | 1 + xmenu.inc | 2 ++ 4 files changed, 22 insertions(+) diff --git a/debian/changelog b/debian/changelog index 461ff57..c02bec4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ gfxboot-theme-ubuntu (0.2.2) UNRELEASED; urgency=low well in tests, so I've left it disabled by not shipping any .mod files. Anyone who would like to try to take this from here and figure out what's wrong would be welcome. + * Improve keyboard navigation in accessibility menu: 0 selects None, and + 1, 2, etc. select other menu items in order (closes: Malone #39303). * Add/update translations from Rosetta: Afrikaans, Arabic, Belarusian, Bengali, Catalan, Kashubian, Danish, Esperanto, Spanish, Estonian, diff --git a/dia_access.inc b/dia_access.inc index b5f0362..d113c22 100644 --- a/dia_access.inc +++ b/dia_access.inc @@ -90,6 +90,22 @@ } def +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +% Handle keyboard input. +% +% ( key_in ) ==> ( key_out ) +% +/access.input { + dup 0 eq { return } if + + dup 0xff and '0' sub + dup 0 ge over xmenu .xm_list get length lt and { + xmenu.select + 0 + } if +} def + + % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % Show window. % @@ -102,6 +118,7 @@ dup .xmenu xmenu.access put dup .xmenu.update /access.update put dup .xmenu.select /access.select put + dup .xmenu.input /access.input put dup window.init window.show } def diff --git a/window.inc b/window.inc index f8fa850..0fb9e92 100644 --- a/window.inc +++ b/window.inc @@ -94,6 +94,7 @@ /.xmenu newfield /.xmenu.update newfield /.xmenu.select newfield +/.xmenu.input newfield % window types /t_dialog 100 def diff --git a/xmenu.inc b/xmenu.inc index c511758..c6764d6 100644 --- a/xmenu.inc +++ b/xmenu.inc @@ -63,6 +63,7 @@ small_layout { widget.size array dup .type t_xmenu put dup .xmenu.select .undef put + dup .xmenu.input .undef put } def @@ -140,6 +141,7 @@ small_layout { pop 0 } if + window.current .xmenu.input get dup .undef ne { exec } { pop } ifelse } def