[PATCH] (better) keyboard navigation for "make xconfig"

Frank Baumgart (godot@uni-paderborn.de)
Sun, 22 Aug 1999 04:33:07 +0200


This is a multi-part message in MIME format.
--------------3BC03EA07B54F5E00747C887
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This patch improves keyboard handling of "make xconfig".

- close "Help" dialogs with <return> or <space>
You do not have to select the "ok" menu button by using <Tab> anymore.

- changed order of submenu buttons to "Prev", "Main Menu", "Next"
- navigate through them with Alt-P/M/N

- quit xconfig with Alt-S (save) or Alt-Q (Quit)

- in the exit confirmation dialog, <Return> confirms, <Escape> cancels

The Patch is based on 2.3.14 but should apply to any recent kernel
cleanly.
Included is a short TODO list, please feel free to comment (by/cc email,
I am not currently subscribed to this list).

Frank
--------------3BC03EA07B54F5E00747C887
Content-Type: text/plain; charset=us-ascii;
name="patch-2.3.14-xconfig.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch-2.3.14-xconfig.diff"

diff -urN scripts.old/TODO.xconfig scripts/TODO.xconfig
--- scripts.old/TODO.xconfig Thu Jan 1 01:00:00 1970
+++ scripts/TODO.xconfig Sun Aug 22 04:26:57 1999
@@ -0,0 +1,36 @@
+TODO list for xconfig 22 August 1999
+
+- disable button behaviour of the description buttons because they aren't
+ buttons UI-wise (but only technically), So clicking on them is nonsense.
+
+- provide help on currently selected/under-mouse configuration on F1
+
+- compare current and loaded configuration and only come up with an exit
+ confirmation dialog if they differ
+
+- add cursor navigation within at least main menu;
+ tab/shift-tab traversal is a nuisance (I know about menuconfig, thanks)
+
+- add internationalization
+ I remember having seen a german configure.help and/or xconfig most
+ probably in a SuSE distro. Is there already a proposal on how to do and
+ maintain it?
+ Please no "non-english capable readers should not configure kernels" :-)
+ As the translators won't have a chance to keep up with bleeding edge
+ kernels, the original english help should be used as a fallback.
+ This feature would of course depend upon $LANG, so do not worry to see
+ bad translations if you do not want to, non-native english readers :)
+
+- provide a visual clue in (at least) the main menu about those submenues
+ with changed configuration entries
+
+- when editing an explicitely loaded configuration display the file name
+ in the main menu
+
+- scroll entry-wise instead of pixel-wise in submenues
+
+- make PageUp/PageDown work at scrollbars
+
+
+Frank Baumgart <godot@upb.de>
+
diff -urN scripts.old/header.tk scripts/header.tk
--- scripts.old/header.tk Thu Jun 3 19:43:35 1999
+++ scripts/header.tk Fri Aug 20 03:07:56 1999
@@ -15,6 +15,9 @@
#
# 24 January 1999, Michael Elizabeth Chastain, <mec@shout.net>
# - Improve the exit message (Jeff Ronne).
+#
+# 20 August 1999, Frank Baumgart, <godot@upb.de>
+# - Keyboard shortcuts for help dialog and exit confirmation dialog

#
# This is a handy replacement for ".widget cget" that requires neither tk4
@@ -115,14 +118,16 @@
message $w.m -width 400 -aspect 300 \
-text "Changes will be lost. Are you sure?" -relief flat
pack $w.m -pady 10 -side top -padx 10
- wm title $w "Are you sure?"
+ wm title $w "Quit without saving?"

set oldFocus [focus]
frame $w.f
button $w.f.back -text "OK" -width 20 \
- -command "exit"
+ -command "exit" -default active
+ bind $w <Return> "$w.f.back invoke"
button $w.f.canc -text "Cancel" \
-width 20 -command "destroy $w; focus $oldFocus"
+ bind $w <Escape> "$w.f.canc invoke"
pack $w.f.back $w.f.canc -side left -pady 10 -padx 45
pack $w.f -pady 10 -side bottom -padx 10 -anchor w
focus $w
@@ -270,7 +275,7 @@
}

proc option_name {w mnum line text helpidx} {
- button $w.x$line.l -text "$text" -relief groove -anchor w
+ button $w.x$line.l -text "$text" -relief groove -anchor w -state disabled
$w.x$line.l configure -activefore [cget $w.x$line.l -fg] \
-activeback [cget $w.x$line.l -bg]
button $w.x$line.help -text "Help" -relief raised \
@@ -287,9 +292,9 @@
-relief groove -width 2 -command "update_menu$mnum .menu$mnum"
radiobutton $w.x$line.n -text "n" -variable $variable -value 0 \
-relief groove -width 2 -command "update_menu$mnum .menu$mnum"
-
+
option_name $w $mnum $line $text $variable
-
+
pack $w.x$line.n $w.x$line.m $w.x$line.y -side right -fill y
}

@@ -417,13 +422,15 @@
#
frame $w.f2
button $w.f2.ok -text "OK" \
- -width 10 -command "destroy $w; focus $oldFocus"
+ -width 10 -command "destroy $w; focus $oldFocus" \
+ -default active
+ bind $w <Return> "$w.f2.ok invoke"
pack $w.f2.ok -side bottom -pady 6 -anchor n
pack $w.f2 -side bottom -padx 10 -anchor s

# Finish off the window
#
- focus $w
+ focus $w.f2.ok
global winx; global winy
set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
wm geometry $w +$winx+$winy
diff -urN scripts.old/tail.tk scripts/tail.tk
--- scripts.old/tail.tk Fri Jan 15 23:36:20 1999
+++ scripts/tail.tk Fri Aug 20 02:08:34 1999
@@ -7,6 +7,9 @@
# 8 January 1998, Michael Elizabeth Chastain, <mec@shout.net>
# Arrange buttons in three columns for better screen fitting.
#
+# 20 August 1999, Frank Baumgart, <godot@upb.de>
+# Added keyboard shortcuts for "Save and Exit" and "Quit"
+#

#
# Read the user's settings from .config. These will override whatever is
@@ -32,10 +35,12 @@
update_mainmenu .f0

button .f0.right.save -anchor w -text "Save and Exit" \
- -command { writeconfig .config include/linux/autoconf.h; wrapup .wrap }
+ -underline 0 -command { writeconfig .config include/linux/autoconf.h; wrapup .wrap }
+bind . <Meta-s> ".f0.right.save invoke"

button .f0.right.quit -anchor w -text "Quit Without Saving" \
- -command { maybe_exit .maybe }
+ -underline 0 -command { maybe_exit .maybe }
+bind . <Meta-q> ".f0.right.quit invoke"

button .f0.right.load -anchor w -text "Load Configuration from File" \
-command { load_configfile .load "Load Configuration from file" read_config_file
diff -urN scripts.old/tkgen.c scripts/tkgen.c
--- scripts.old/tkgen.c Thu Jun 3 19:44:47 1999
+++ scripts/tkgen.c Sun Aug 22 04:11:27 1999
@@ -92,6 +92,9 @@
*
* 23 January 1999, Michael Elizabeth Chastain <mec@shout.net>
* - Remove bug-compatible code.
+ *
+ * 20 August 1999, Frank Baumgart <godot@upb.de>
+ * - added keyboard navigation for Main Menu, Next and Prev
*/

#include <stdio.h>
@@ -129,17 +132,26 @@
*/
printf( "\tset oldFocus [focus]\n" );
printf( "\tframe $w.f\n" );
- printf( "\tbutton $w.f.back -text \"Main Menu\" \\\n" );
+
+ printf( "\tbutton $w.f.prev -text \"Prev\" -underline 0 \\\n" );
+ printf( "\t\t-width 15 -command \" destroy $w; focus $oldFocus; menu%d .menu%d \\\"$title\\\"\"\n", menu_num-1, menu_num-1 );
+ printf( "\tbind $w <Meta-p> \"$w.f.prev invoke\"\n" );
+ if ( menu_num == 1 )
+ printf( "\t$w.f.prev configure -state disabled\n" );
+
+ printf( "\tbutton $w.f.back -text \"Main Menu\" -underline 0 \\\n" );
printf( "\t\t-width 15 -command \"destroy $w; focus $oldFocus; update_mainmenu $w\"\n" );
- printf( "\tbutton $w.f.next -text \"Next\" \\\n" );
+ printf( "\tbind $w <Meta-m> \"$w.f.back invoke\"\n" );
+ printf( "\tbind $w <Escape> \"$w.f.back invoke\"\n" );
+
+ printf( "\tbutton $w.f.next -text \"Next\" -underline 0 \\\n" );
printf( "\t\t-width 15 -command \" destroy $w; focus $oldFocus; menu%d .menu%d \\\"$title\\\"\"\n", menu_num+1, menu_num+1 );
+ printf( "\tbind $w <Meta-n> \"$w.f.next invoke\"\n" );
if ( menu_num == tot_menu_num )
printf( "\t$w.f.next configure -state disabled\n" );
- printf( "\tbutton $w.f.prev -text \"Prev\" \\\n" );
- printf( "\t\t-width 15 -command \" destroy $w; focus $oldFocus; menu%d .menu%d \\\"$title\\\"\"\n", menu_num-1, menu_num-1 );
- if ( menu_num == 1 )
- printf( "\t$w.f.prev configure -state disabled\n" );
- printf( "\tpack $w.f.back $w.f.next $w.f.prev -side left -expand on\n" );
+
+ /* printf( "\tpack $w.f.back $w.f.next $w.f.prev -side left -expand on\n" );*/
+ printf( "\tpack $w.f.prev $w.f.back $w.f.next -side left -expand on\n" );
printf( "\tpack $w.f -pady 10 -side bottom -anchor w -fill x\n" );

/*

--------------3BC03EA07B54F5E00747C887--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/