Remove native scan code from CKeyboardKey

Remove isPressed status from CKeyboardKey
Switched key value to Qt::Key

There is no way on OSX to get the native scan code of a key.
Therefore it is removed from this class, because we might
create dependent code which will not run on OSX.
CKeyboardKey is a abstraction of platform keys. It was representing
also the status when CKeyboardKey was sent in signals. So this
can be removed. Pressed status is sent as argument to the registered
method.

refs #83
This commit is contained in:
Roland Winklmeier
2014-03-05 13:27:20 +01:00
parent b0d55687bd
commit 9a5f2b2003
3 changed files with 25 additions and 51 deletions

View File

@@ -135,8 +135,7 @@ namespace BlackGui
{
const Qt::Key k = static_cast<Qt::Key>(event->key());
if (k == Qt::Key_Shift || k == Qt::Key_Control || k == Qt::Key_Meta || k == Qt::Key_Alt || k == Qt::Key_CapsLock || k == Qt::Key_NumLock || k == Qt::Key_ScrollLock) return;
this->m_key.setKey(event->key());
this->m_key.setNativeScanCode(event->nativeScanCode());
this->m_key.setKey(k);
this->m_key.setNativeVirtualKey(event->nativeVirtualKey());
this->setText(CKeyboardKey::toStringRepresentation(event->key()));
}