• 5363阅读
  • 3回复

【提问】键盘问题刚刚解决,又有新的问题 [复制链接]

上一主题 下一主题
离线roy_skyx
 

只看楼主 倒序阅读 楼主  发表于: 2006-02-20
在qt的source文件中,修改qt/src/kernel/qkeyboard_qws.cpp 这个文件,加上自己的键盘驱动程序,就可以完成键盘的超作。

新的问题是:在X86上,通过虚拟framebuffer,在对话框中创建一个列表框,键盘的动作在对话框和列表框中都有响应。但是,当移到target板上后,只有对话框中的keyReleaseEvent有响应,而列表框中的keyReleaseEvent没有收到任何事件,实在是不知道key event事件是怎么传递的?
离线reserver

只看该作者 1楼 发表于: 2006-02-22
请问是怎样与键盘驱动联系起来的,能否把代码贴出来看看啊
离线roy_skyx

只看该作者 2楼 发表于: 2006-02-23
在上诉文件中在中个函数中加上你的键盘处理handle
QWSKeyboardHandler *QWSServer::newKeyboardHandler( const QString &spec )
{
  QWSKeyboardHandler *handler = 0;

  QString device;
  QString type;
  int colon=spec.find(':');
  if ( colon>=0 ) {
     type = spec.left(colon);
     device = spec.mid(colon+1);
  } else {
     type = spec;
  }

  if ( type == "Buttons" ) {
#if defined(QT_QWS_YOPY)
     qWarning( "Keyboard type %s:%s supported", spec.latin1(), device.latin1() );            
     handler = new QWSyopyButtonsHandler();
#elif defined(QT_QWS_CASSIOPEIA)
     qWarning( "Keyboard type %s:%s supported", spec.latin1(), device.latin1() );            
     handler = new QWSVr41xxButtonsHandler();
#endif
  } else if ( type == "QVFbKeyboard" ) {
     qWarning( "Keyboard type %s:%s supported", spec.latin1(), device.latin1() );            
     handler = new QWSVFbKeyboardHandler();
  } else if ( type == "USB" ) {
     qWarning( "Keyboard type %s:%s supported", spec.latin1(), device.latin1() );              
     handler = new QWSUsbKeyboardHandler(device);
  } else if ( type == "TTY" ) {
     qWarning( "Keyboard type %s:%s supported", spec.latin1(), device.latin1() );            
     handler = new QWSTtyKeyboardHandler(device);
  }
  else if( type == "Samsung" ) {
     qWarning( "Keyboard type %s:%s supported", spec.latin1(), device.latin1() );            
     handler = new QWSSamsungKeypadHandler(device);
  }
  else if( type == "Mykeyboard" ) {/*新加的键盘处理程序handler*/
     qWarning( "Keyboard type %s:%s supported", spec.latin1(), device.latin1() );            
     handler = new QWSMykeyboardadHandler(device);
  }
  else {
     qWarning( "Keyboard type %s:%s unsupported", spec.latin1(), device.latin1() );
  }

  return handler;
}
仿照Samsung handel加上你的handle处理程序就可以了
离线reserver

只看该作者 3楼 发表于: 2006-02-23
谢谢了
快速回复
限100 字节
 
上一个 下一个