mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-24 03:23:15 +03:00
sticky keys fix doesn't work, may make things worse - backed out [no-issue]
This commit is contained in:
parent
3a6d9e82e3
commit
c4dd6eb61c
@ -458,47 +458,6 @@ COSXKeyState::pollPressedKeys(KeyButtonSet& pressedKeys) const
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
COSXKeyState::fixStickyKeys()
|
||||
{
|
||||
KeyModifierMask synergyMask = getActiveModifiers();
|
||||
KeyModifierMask hardwareMask = pollActiveModifiers();
|
||||
if (synergyMask != hardwareMask) {
|
||||
|
||||
// modifier key stuck
|
||||
// compute changed modifiers
|
||||
KeyModifierMask changed = (hardwareMask ^ synergyMask);
|
||||
|
||||
if (changed) {
|
||||
KeyButton kb;
|
||||
CString keyFixed;
|
||||
// synthesize changed modifier keys
|
||||
if ((changed & KeyModifierShift) != 0) {
|
||||
kb = mapVirtualKeyToKeyButton(s_shiftVK);
|
||||
fakeKeyUp(kb);
|
||||
keyFixed.append("shift ");
|
||||
}
|
||||
if ((changed & KeyModifierControl) != 0) {
|
||||
kb = mapVirtualKeyToKeyButton(s_controlVK);
|
||||
fakeKeyUp(kb);
|
||||
keyFixed.append("ctrl ");
|
||||
}
|
||||
if ((changed & KeyModifierAlt) != 0) {
|
||||
kb = mapVirtualKeyToKeyButton(s_altVK);
|
||||
fakeKeyUp(kb);
|
||||
keyFixed.append("alt ");
|
||||
}
|
||||
if ((changed & KeyModifierSuper) != 0) {
|
||||
kb = mapVirtualKeyToKeyButton(s_superVK);
|
||||
fakeKeyUp(kb);
|
||||
keyFixed.append("cmd ");
|
||||
}
|
||||
|
||||
LOG((CLOG_DEBUG "fixed stuck modifier key: %s", keyFixed.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
COSXKeyState::getKeyMap(CKeyMap& keyMap)
|
||||
{
|
||||
|
@ -99,7 +99,7 @@ public:
|
||||
pollActiveModifiers() const;
|
||||
virtual SInt32 pollActiveGroup() const;
|
||||
virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const;
|
||||
void fixStickyKeys();
|
||||
|
||||
protected:
|
||||
// CKeyState overrides
|
||||
virtual void getKeyMap(CKeyMap& keyMap);
|
||||
|
@ -527,8 +527,6 @@ COSXScreen::postMouseEvent(CGPoint& pos) const
|
||||
void
|
||||
COSXScreen::fakeMouseButton(ButtonID id, bool press)
|
||||
{
|
||||
m_keyState->fixStickyKeys();
|
||||
|
||||
NXEventHandle handle = NXOpenEventStatus();
|
||||
double clickTime = NXClickTime(handle);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user