On Monday 05 September 2005 13:19, Craig Howard wrote: > I'm writing a GUI for a library and I need to translate key combinations > like CTRL+Y from the QKeyEvent into the string "y" > > What I'm doing right now is testing the event->keyboardModifier() and > adding that to the string, then adding event->text(). However, when a key > like CTRL is down, event->text() for the above CTRL+Y gives me the string > "\031", even though event->key() == Qt::Key_Y. > > How can I make event->key() and event->text() return the same thing in this > case? Thanks. For the record, I got an answer to this question on one of the Qt newsgroups. I did QString keySeq( QKeySequence( event->key() + event->modifier() ) ); and then performed operations on the returned string to get it into the format I wanted. -- Craig Howard >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<