cspp
30th June 2009, 02:21
My Platform is WinXp+VC6.0+Qt3.
I rewrite the QWidget::keyPressEvent(QKeyEvent* e).
but something wrong about it,
if I press the key 'a',the e.key() = 65 and text is 'a',the state = 0,but the ascii is 97; OK
if I press the key 'b',the e.key() = 66 and text is 'b',the state = 0,but the ascii is 98; OK
if I press the key "Ctrl+a",the e.key = 65,and text().ascii()[0] = 1,the stete = 512; Err;
if I press the key "Shift+a",the e.key = 65,and text() = 'A',the ascii = 65;OK
so I want to know why I press the key "Ctrl+a",the text() is not 'a'?and why the key() is always equal to 65 and not equal to 97?
thanks!
I rewrite the QWidget::keyPressEvent(QKeyEvent* e).
but something wrong about it,
if I press the key 'a',the e.key() = 65 and text is 'a',the state = 0,but the ascii is 97; OK
if I press the key 'b',the e.key() = 66 and text is 'b',the state = 0,but the ascii is 98; OK
if I press the key "Ctrl+a",the e.key = 65,and text().ascii()[0] = 1,the stete = 512; Err;
if I press the key "Shift+a",the e.key = 65,and text() = 'A',the ascii = 65;OK
so I want to know why I press the key "Ctrl+a",the text() is not 'a'?and why the key() is always equal to 65 and not equal to 97?
thanks!