标题:【提问】keypad question of qtembeded-2.3.10
作者:roy_skyx
日期:2006-02-20 18:05
内容:
I have a keypad on my target board. and I have install the keypad device driver. and the program can work will on target board. but my qtembeded cannot get any key event.why?
#include
#include
#include
#include
#include
int main( int argc, char *argv[] )
{
int fd= -1 ;
unsigned char key;
int ret = 0;
// Open the device
fd = open( "/dev/keypad", O_RDONLY ) ;
if ( -1 == fd )
{
printf( "Error: could not open /dev/keypad device .\n") ;
return 1 ;
}
/* argument is the keypad debounce timeout in ticks */
if(argc == 2) {
ioctl(fd, 1, atoi(argv[1]));
}
do {
ret = read(fd, &key, 1);
if(ret)
----》 printf("Rcvda key from Keypad \n", key);
sleep(1);
ret = 0;
}while(1);
close( fd ) ;
return 0 ;
}
我按任何键的时候,都有打印信息出来,而且键值不同。但是qt中按任何键,都没有反应,不知道问题出在什么地方?
qt的配置是
./configure -xplatform linux-arm-g++ -keypad-mode -depths16 -no-xft
产生config文件的的时候
选择5-全部安装,
选择no qvfb
在./configure --help 配置中还有一个选项-keypad-input,但是加上这个选项后配置不能通过。这个选项是做什么的?
#1 [liu_ming50 03-07 01:35]
是不是你在src/kernel/keybord_qws.cpp中没有加上你得keypad driver 啊?编译时的-keypad-input好像是一种键盘种类吧,在src/kernel/keybord_qws.cpp中支持好几种键盘,默认是pc标准键盘。好像是这样,是我自己的理解,希望对你有帮助,希望高手来解答。
#2 [roy_skyx 03-07 01:42]
谢谢,这个问题已经解决,原因就是你说的,在运行程序前加上export QWS_KEYBOARD=*****就可以了。现在的新问题是键盘事件响应问题,刚发贴。