refactor: EIKeyState::fakeKey use if in place of a switch that cares only about a single case
This commit is contained in:
parent
0501f2892d
commit
507c98adff
1 changed files with 8 additions and 11 deletions
|
|
@ -277,17 +277,14 @@ void EiKeyState::getKeyMap(deskflow::KeyMap &keyMap)
|
||||||
|
|
||||||
void EiKeyState::fakeKey(const Keystroke &keystroke)
|
void EiKeyState::fakeKey(const Keystroke &keystroke)
|
||||||
{
|
{
|
||||||
switch (keystroke.m_type) {
|
if (keystroke.m_type != Keystroke::KeyType::Button)
|
||||||
case Keystroke::KeyType::Button:
|
return;
|
||||||
LOG_DEBUG1(
|
|
||||||
"fake key: %03x (%08x) %s", keystroke.m_data.m_button.m_button, keystroke.m_data.m_button.m_client,
|
LOG_DEBUG1(
|
||||||
keystroke.m_data.m_button.m_press ? "down" : "up"
|
"fake key: %03x (%08x) %s", keystroke.m_data.m_button.m_button, keystroke.m_data.m_button.m_client,
|
||||||
);
|
keystroke.m_data.m_button.m_press ? "down" : "up"
|
||||||
m_screen->fakeKey(keystroke.m_data.m_button.m_button, keystroke.m_data.m_button.m_press);
|
);
|
||||||
break;
|
m_screen->fakeKey(keystroke.m_data.m_button.m_button, keystroke.m_data.m_button.m_press);
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyID EiKeyState::mapKeyFromKeyval(uint32_t keyval) const
|
KeyID EiKeyState::mapKeyFromKeyval(uint32_t keyval) const
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue