mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-26 04:25:00 +03:00
e2a31e8b66
changed locking to screen so that keys no longer count (only mouse buttons and scroll lock toggled on). This is to deal with the unreliability of key event reporting which can leave us locked to a screen with no key physically pressed. The result of this is that clients get key repeats and releases without the corresponding key press. CKeyState handles this by discarding repeat/release events on keys it hasn't seen go down. Also made a few other minor fixes to win32 keyboard handling.
89 lines
1.7 KiB
C++
89 lines
1.7 KiB
C++
/*
|
|
* synergy -- mouse and keyboard sharing utility
|
|
* Copyright (C) 2004 Chris Schoeneman
|
|
*
|
|
* This package is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* found in the file COPYING that should have accompanied this file.
|
|
*
|
|
* This package is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#include "CPlatformScreen.h"
|
|
|
|
CPlatformScreen::CPlatformScreen()
|
|
{
|
|
// do nothing
|
|
}
|
|
|
|
CPlatformScreen::~CPlatformScreen()
|
|
{
|
|
// do nothing
|
|
}
|
|
|
|
void
|
|
CPlatformScreen::updateKeys()
|
|
{
|
|
getKeyState()->updateKeys();
|
|
updateButtons();
|
|
}
|
|
|
|
void
|
|
CPlatformScreen::setHalfDuplexMask(KeyModifierMask mask)
|
|
{
|
|
getKeyState()->setHalfDuplexMask(mask);
|
|
}
|
|
|
|
void
|
|
CPlatformScreen::fakeKeyDown(KeyID id, KeyModifierMask mask,
|
|
KeyButton button)
|
|
{
|
|
getKeyState()->fakeKeyDown(id, mask, button);
|
|
}
|
|
|
|
void
|
|
CPlatformScreen::fakeKeyRepeat(KeyID id, KeyModifierMask mask,
|
|
SInt32 count, KeyButton button)
|
|
{
|
|
getKeyState()->fakeKeyRepeat(id, mask, count, button);
|
|
}
|
|
|
|
void
|
|
CPlatformScreen::fakeKeyUp(KeyButton button)
|
|
{
|
|
getKeyState()->fakeKeyUp(button);
|
|
}
|
|
|
|
void
|
|
CPlatformScreen::fakeToggle(KeyModifierMask modifier)
|
|
{
|
|
getKeyState()->fakeToggle(modifier);
|
|
}
|
|
|
|
bool
|
|
CPlatformScreen::fakeCtrlAltDel()
|
|
{
|
|
return getKeyState()->fakeCtrlAltDel();
|
|
}
|
|
|
|
bool
|
|
CPlatformScreen::isKeyDown(KeyButton button) const
|
|
{
|
|
return getKeyState()->isKeyDown(button);
|
|
}
|
|
|
|
KeyModifierMask
|
|
CPlatformScreen::getActiveModifiers() const
|
|
{
|
|
return getKeyState()->getActiveModifiers();
|
|
}
|
|
|
|
const char*
|
|
CPlatformScreen::getKeyName(KeyButton button) const
|
|
{
|
|
return getKeyState()->getKeyName(button);
|
|
}
|