1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2024-12-22 23:43:00 +02:00

cngt: some small fixes

- Makefile: updated program name in title comment
- cngt.c (do_key): "l" moved left, like "h"
- cngt.c (main): when starting, immediately move to initial position
- getkey.c (tty_open): open /dev/tty read-only, not write-only
This commit is contained in:
Werner Almesberger 2010-12-15 22:40:43 -03:00
parent 154be2bada
commit 62152e2987
3 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#
# Makefile - Makefile of drl2gp
# Makefile - Makefile of cngt
#
# Written 2010 by Werner Almesberger
# Copyright 2010 by Werner Almesberger

View File

@ -77,7 +77,7 @@ static int do_key(char c)
break;
case 'l':
up();
x -= STEP;
x += STEP;
move();
break;
case 'q':
@ -124,6 +124,7 @@ int main(int argc, char **argv)
x = pos_x[0];
y = pos_y[0];
z = z0+height;
move();
while ((c = getkey()))
if (do_key(c))

View File

@ -40,7 +40,7 @@ static void tty_open(void)
{
struct termios new;
tty = open(TTY_NAME, O_WRONLY | O_NOCTTY);
tty = open(TTY_NAME, O_RDONLY | O_NOCTTY);
if (tty < 0) {
perror(TTY_NAME);
exit(1);