Your message dated Wed, 25 May 2005 02:30:59 -0500
with message-id <[EMAIL PROTECTED]>
and subject line Bug#310658: Acknowledgement (bsdgames: atc direction keys
don't make sense with dvorak layout)
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 25 May 2005 02:55:51 +0000
>From [EMAIL PROTECTED] Tue May 24 19:55:51 2005
Return-path: <[EMAIL PROTECTED]>
Received: from kwai.cs.uiuc.edu [128.174.245.87]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1Dam3i-0004sX-00; Tue, 24 May 2005 19:55:51 -0700
Received: from tdbrown by kwai.cs.uiuc.edu with local (Exim 4.50)
id 1Dam37-0003oZ-V5
for [EMAIL PROTECTED]; Tue, 24 May 2005 21:55:14 -0500
Received: from thecap by derby. with local (Exim 4.34)
id 1DakUL-00065l-2O; Tue, 24 May 2005 18:15:13 -0700
Content-Type: multipart/mixed; boundary="===============0954771238=="
MIME-Version: 1.0
From: Tom <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: bsdgames: atc direction keys don't make sense with dvorak layout
X-Mailer: reportbug 3.2
Date: Tue, 24 May 2005 18:15:12 -0700
Message-Id: <[EMAIL PROTECTED]>
Sender: Tom <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-5.1 required=4.0 tests=BAYES_44,HAS_PACKAGE
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level:
X-CrossAssassin-Score: 2
This is a multi-part MIME message sent by reportbug.
--===============0954771238==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Package: bsdgames
Version: 2.17-1
Severity: wishlist
Tags: patch
A wrote a patch for atc a couple years ago. It changes the keys used for
direction in the RULES structs depending on a command line option. I
just cleaned it up a bit to work with 2.17 in hope that others can use
it.
Please forward this feature to upstream if you think they may want it.
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages bsdgames depends on:
ii libc6 2.3.2.ds1-18 GNU C Library: Shared libraries an
ii libgcc1 1:3.4.2-2 GCC support library
ii libncurses5 5.4-4 Shared libraries for terminal hand
ii libstdc++5 1:3.3.4-13 The GNU Standard C++ Library v3
ii wamerican [wordlist] 5-4 American English dictionary words
ii wbritish [wordlist] 5-4 British English dictionary words f
ii wenglish 5-4 American English dictionary words
-- no debconf information
--===============0954771238==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="bsdgames-2.17-1_keyboard_map_patch"
diff -ru bsdgames-2.17-1.orig/atc/atc.6.in bsdgames-2.17-1.mine/atc/atc.6.in
--- bsdgames-2.17-1.orig/atc/atc.6.in 2004-01-02 10:04:51.000000000 -0800
+++ bsdgames-2.17-1.mine/atc/atc.6.in 2005-05-24 13:06:48.000000000 -0700
@@ -45,6 +45,7 @@
.Op Fl u?lstp
.Op Fl gf Ar "game name"
.Op Fl r Ar "random seed"
+.Op Fl k Ar "keyboard"
.Sh DESCRIPTION
.Nm
lets you try your hand at the nerve wracking duties of the air traffic
@@ -81,6 +82,11 @@
.It Fl f Ar game
Same as
.Fl g .
+.It Fl k Ar keyboard
+Select an alternate keyboard map for the direction keys. ``dvorak'' uses
+keys around ``o'' in dvorak layout and ``numpad'' uses the numbers
+found on the right of many keyboards. The default is ``qwerty'', described in
+.Sx INPUT .
.It Fl r Ar seed
Set the random seed.
The purpose of this flag is questionable.
@@ -223,11 +229,14 @@
.Em [0\-9]
means any single digit, and
.Aq Em dir
-refers to a direction, given by the keys around the `s' key: ``wedcxzaq''.
+refers to a direction, given by a square of keys on the keyboard, by
+default the keys around the `s' in a qwerty layout: ``wedcxzaq''. The
+.Fl k
+option may be used to select a different group of keys.
In absolute references, `q' refers to North-West or 315 degrees, and `w'
refers to North, or 0 degrees.
In relative references, `q' refers to \-45 degrees or 45 degrees left, and `w'
-refers to 0 degrees, or no change in direction.
+refers to 0 degrees, or no change in direction.
.Pp
All commands start with a plane letter.
This indicates the recipient of the command.
@@ -280,7 +289,10 @@
(not
.Em to
.Aq dir . )
-`w' (0 degrees) is no turn.
+With the default keyboard map (
+.Fl k
+qwerty
+) `w' (0 degrees) is no turn.
`e' is 45 degrees; `q' gives \-45 degrees counterclockwise, that is,
45 degrees clockwise.
.It "t- [ dir ]"
diff -ru bsdgames-2.17-1.orig/atc/def.h bsdgames-2.17-1.mine/atc/def.h
--- bsdgames-2.17-1.orig/atc/def.h 2003-12-16 18:47:37.000000000 -0800
+++ bsdgames-2.17-1.mine/atc/def.h 2005-05-21 05:45:36.000000000 -0700
@@ -60,6 +60,8 @@
#define MAXDIR 8
+#define KEYBOARD_DIR_NUM 3
+
#define D_LEFT 1
#define D_RIGHT 2
#define D_UP 3
diff -ru bsdgames-2.17-1.orig/atc/extern.c bsdgames-2.17-1.mine/atc/extern.c
--- bsdgames-2.17-1.orig/atc/extern.c 2003-12-16 18:47:37.000000000 -0800
+++ bsdgames-2.17-1.mine/atc/extern.c 2005-05-21 05:45:36.000000000 -0700
@@ -54,7 +54,7 @@
char GAMES[] = "Game_List";
-int clck, safe_planes, start_time, test_mode;
+int clck, safe_planes, start_time, test_mode, keyboard_dir;
const char *file;
@@ -66,6 +66,18 @@
struct termios tty_start, tty_new;
+const char keyboard_dir_maps[KEYBOARD_DIR_NUM][MAXDIR] = {
+ {'w','e','d','c','x','z','a','q' },
+ {',','.','e','j','q',';','a','\'' },
+ {'8','9','6','3','2','1','4','7' }
+};
+
+const char * keyboard_dir_names[KEYBOARD_DIR_NUM] = {
+ "qwerty",
+ "dvorak",
+ "numpad"
+};
+
DISPLACEMENT displacement[MAXDIR] = {
{ 0, -1 },
{ 1, -1 },
diff -ru bsdgames-2.17-1.orig/atc/extern.h bsdgames-2.17-1.mine/atc/extern.h
--- bsdgames-2.17-1.orig/atc/extern.h 2004-01-27 12:52:07.000000000 -0800
+++ bsdgames-2.17-1.mine/atc/extern.h 2005-05-24 12:49:10.000000000 -0700
@@ -46,7 +46,11 @@
extern char GAMES[];
extern const char *file;
-extern int clck, safe_planes, start_time, test_mode;
+extern int clck, safe_planes, start_time, test_mode, keyboard_dir;
+
+const char keyboard_dir_maps[KEYBOARD_DIR_NUM][MAXDIR];
+
+const char * keyboard_dir_names[KEYBOARD_DIR_NUM];
extern FILE *filein, *fileout;
@@ -84,6 +88,7 @@
void ioclrtoeol(int);
void ioerror(int, int, const char *);
void iomove(int);
+int keyboard_dir_remap(const char *);
int list_games(void);
int log_score(int);
void log_score_quit(int) __attribute__((__noreturn__));
diff -ru bsdgames-2.17-1.orig/atc/input.c bsdgames-2.17-1.mine/atc/input.c
--- bsdgames-2.17-1.orig/atc/input.c 2005-02-15 22:24:50.000000000 -0800
+++ bsdgames-2.17-1.mine/atc/input.c 2005-05-24 12:49:26.000000000 -0700
@@ -657,19 +657,65 @@
{
int dir;
- dir = -1;
- switch (ch) {
- case 'w': dir = 0; break;
- case 'e': dir = 1; break;
- case 'd': dir = 2; break;
- case 'c': dir = 3; break;
- case 'x': dir = 4; break;
- case 'z': dir = 5; break;
- case 'a': dir = 6; break;
- case 'q': dir = 7; break;
- default:
- fprintf(stderr, "bad character in dir_no\n");
- break;
+ for( dir=0; dir<MAXDIR; ++dir ) {
+ if( ch == keyboard_dir_maps[keyboard_dir][dir] )
+ return (dir);
}
- return (dir);
+
+ fprintf(stderr, "bad character in dir_no\n");
+ return (-1);
+}
+
+// Load the map for the selected keyboard_dir into passed state rules
+// Call once for each state that uses the direction keys. Do not call
+// more than once with the same state.
+void
+keyboard_dir_load(state)
+ STATE state;
+{
+ int rule = 0;
+ int key = 0;
+
+ // Find the first direction rule by looking for the default
+ // key binding
+ while( rule<state.num_rules && state.rule[rule].token!='w' )
+ ++rule;
+
+ // Copy the new key bindings
+ for( key=0; key<MAXDIR && rule<state.num_rules; ) {
+ state.rule[rule].token = keyboard_dir_maps[keyboard_dir][key];
+ rule++;
+ key++;
+ }
+
}
+
+// Pass the name of a keyboard_dir map. Returns 1 on success,
+// -1 on error.
+// Call once to rename the keybindings in the rules. Do not call
+// again in the same execution.
+int
+keyboard_dir_remap(name)
+ const char *name;
+{
+ int i;
+
+ for( i=0; i<KEYBOARD_DIR_NUM; i++ ) {
+ if( strcmp(name, keyboard_dir_names[i]) == 0) {
+ keyboard_dir = i;
+ if( i > 0 ) {
+ // If name is not the default then modify the
RULE structs for states that use directions
+ keyboard_dir_load(st[2]);
+ keyboard_dir_load(st[6]);
+ }
+ return 1;
+ }
+ }
+
+ fprintf( stderr, "Bad key map name. Your choices are: " );
+ for( i=0; i<KEYBOARD_DIR_NUM; i++ ) {
+ fprintf( stderr, "%s%s", keyboard_dir_names[i],
i!=(KEYBOARD_DIR_NUM-1)? ", " : "\n" );
+ }
+ return -1;
+}
+
diff -ru bsdgames-2.17-1.orig/atc/main.c bsdgames-2.17-1.mine/atc/main.c
--- bsdgames-2.17-1.orig/atc/main.c 2003-12-16 18:47:37.000000000 -0800
+++ bsdgames-2.17-1.mine/atc/main.c 2005-05-24 12:33:18.000000000 -0700
@@ -70,6 +70,7 @@
int f_printpath = 0;
const char *file = NULL;
int ch;
+ const char *keyboard_dir_name = NULL;
struct sigaction sa;
#ifdef BSD
struct itimerval itv;
@@ -81,7 +82,7 @@
start_time = seed = time(NULL);
- while ((ch = getopt(ac, av, "ulstpg:f:r:")) != -1) {
+ while ((ch = getopt(ac, av, "ulstpg:f:r:k:")) != -1) {
switch (ch) {
case '?':
case 'u':
@@ -105,6 +106,9 @@
case 'g':
file = optarg;
break;
+ case 'k':
+ keyboard_dir_name = optarg;
+ break;
}
}
if (optind < ac)
@@ -113,7 +117,7 @@
if (f_usage)
fprintf(stderr,
- "Usage: %s -[u?lstp] [-[gf] game_name] [-r random seed]\n",
+ "Usage: %s -[u?lstp] [-[gf] game_name] [-r random seed] [-k
keyboard map]\n",
av[0]);
if (f_showscore)
log_score(1);
@@ -135,9 +139,17 @@
else
file = okay_game(file);
+ // Force use of default keyboard when reading game
+ keyboard_dir = 0;
if (file == NULL || read_file(file) < 0)
exit(1);
+ if (keyboard_dir_name == NULL)
+ keyboard_dir = 0;
+ else
+ if (keyboard_dir_remap(keyboard_dir_name) < 0)
+ exit(1);
+
init_gr();
setup_screen(sp);
--===============0954771238==--
---------------------------------------
Received: (at 310658-done) by bugs.debian.org; 25 May 2005 07:31:37 +0000
>From [EMAIL PROTECTED] Wed May 25 00:31:37 2005
Return-path: <[EMAIL PROTECTED]>
Received: from kwai.cs.uiuc.edu [128.174.245.87]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1DaqMb-0000HH-00; Wed, 25 May 2005 00:31:37 -0700
Received: from tdbrown by kwai.cs.uiuc.edu with local (Exim 4.50)
id 1DaqLz-0003xA-V0
for [EMAIL PROTECTED]; Wed, 25 May 2005 02:30:59 -0500
Date: Wed, 25 May 2005 02:30:59 -0500
From: Tom Brown <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: Bug#310658: Acknowledgement (bsdgames: atc direction keys don't
make sense with dvorak layout)
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[EMAIL PROTECTED]>
X-URL: http://thecap.org
Organization: Society for the Elimination of Excess Superfluous Text in
Internet Header Lines (SEESTIHL)
User-Agent: Mutt/1.5.9i
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level:
exact duplicate of 310657 created by my new smarthost exim4 conf
which I will now debug. Developer's Reference says I should merge
duplicates so all submitters get updates but that doesn't seem to
apply here.
--
Tom Brown [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]