Files
barrier/lib/synergy/CPlatformScreen.cpp
crs 8d99fd2511 Checkpoint. Converted X11 to new keyboard state tracking design.
This new design is simpler.  For keyboard support, clients need only
implement 4 virtual methods on a class derived from CKeyState and
one trivial method in the class derived from CPlatformScreen, which
is now the superclass of platform screens instead of IPlatformScreen.
Keyboard methods have been removed from IPlatformScreen, IPrimaryScreen
and ISecondaryScreen.  Also, all keyboard state tracking is now in
exactly one place (the CKeyState subclass) rather than in CScreen,
the platform screen, and the key mapper.  Still need to convert Win32.
2004-03-21 20:01:41 +00:00

83 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::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);
}