[Armadillo:00589] Re: Read keyboard characters without echoing

Yusuf Ahmad, Noida email@hidden
2005年 10月 31日 (月) 22:22:00 JST


Hi Fumito San,

I wanted to put the screen in Graphics mode. So I needed to stop echoing of keyboard characters.

The way you are suggesting will surely work. I am writing below the way I followed.

I am using IOCTL() to set the keyboard in MEDIUM RAW mode and GRAPHICS MODE.
The original mode is saved and keyboard is restored to original mode on application exit. 

{
int saved_kbd_mode;
struct termios saved_kbd_termios;
struct termios keyboard_termios;


kfd = 0; /* keyboard fd*/
ioctl(kfd, KDGKBMODE, &saved_kbd_mode);
tcgetattr(kfd, &saved_kbd_termios);
keyboard_termios = saved_kbd_termios;
keyboard_termios.c_lflag &= ~(ICANON | ECHO | ISIG);
keyboard_termios.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
keyboard_termios.c_cc[VMIN] = 0;
keyboard_termios.c_cc[VTIME] = 0;

tcsetattr(kfd, TCSAFLUSH, &keyboard_termios);
ioctl(kfd, KDSKBMODE, K_MEDIUMRAW);
ioctl(kfd, KDSETMODE, KD_GRAPHICS);

read(kfd,..);
:
: /* Application logic */
:
/* Upon application Exit, restore the original keyboard mode */
ioctl(kfd, KDSETMODE, KD_TEXT);
ioctl(kfd, KDSKBMODE, saved_kbd_mode);
tcsetattr(kfd, TCSAFLUSH, &saved_kbd_termios);

return 0;
}

Thank you very much for the help.

Best regards,
Yusuf











-----Original Message-----
From: Fumito Morishima [mailto:email@hidden] 
Sent: Monday, October 31, 2005 6:27 PM
To: Armadillo series general discussion list
Subject: [Armadillo:00587] Re: Read keyboard characters without echoing

Hello,

I'm not so sure what exactly you'd like to do, but how about these steps
below:

1. Configure the kernel to enable input devices layer.
 Device Drivers --->
    Input device support --->
       <*> Event interface

2. Modify /etc/inittab to stop getty on VGA(login from /dev/ttyAM0 or
telnet).
 #::respawn:/sbin/getty 38400 tty1 <-- comment out

3. Make /dev/input directory and make /dev/input/event0 device file to
get the event from keyboard, like below.
 a9# mknod /dev/input/event0 c 13 64

4. Check whether you can see the keyboard event(USB keyboard must be
connected).
 a9# od -x /dev/input/event0

Regards,

Fumito

Yusuf Ahmad, Noida wrote:
> Hi,
> 
>  
> 
> Please give me some hint on how to read characters from keyboard without 
> echoing on console screen.
> 
>  
> 
> Thanks for the help.
> 
>  
> 
> Best Regards,
> 
> Yusuf
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> armadillo mailing list
> email@hidden
> http://lists.atmark-techno.com/mailman/listinfo/armadillo
_______________________________________________
armadillo mailing list
email@hidden
http://lists.atmark-techno.com/mailman/listinfo/armadillo



armadillo メーリングリストの案内