barrier/src/lib/synergy/PlatformScreen.cpp

124 lines
2.5 KiB
C++
Raw Normal View History

2012-06-10 16:50:54 +00:00
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Synergy Si Ltd.
* Copyright (C) 2004 Chris Schoeneman
2012-06-10 16:50:54 +00:00
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "synergy/PlatformScreen.h"
#include "synergy/App.h"
#include "synergy/ArgsBase.h"
2012-06-10 16:50:54 +00:00
2014-11-11 13:51:47 +00:00
PlatformScreen::PlatformScreen(IEventQueue* events) :
IPlatformScreen(events),
m_draggingStarted(false),
m_fakeDraggingStarted(false)
2012-06-10 16:50:54 +00:00
{
}
2014-11-11 13:51:47 +00:00
PlatformScreen::~PlatformScreen()
2012-06-10 16:50:54 +00:00
{
// do nothing
}
void
2014-11-11 13:51:47 +00:00
PlatformScreen::updateKeyMap()
2012-06-10 16:50:54 +00:00
{
getKeyState()->updateKeyMap();
}
void
2014-11-11 13:51:47 +00:00
PlatformScreen::updateKeyState()
2012-06-10 16:50:54 +00:00
{
getKeyState()->updateKeyState();
updateButtons();
}
void
2014-11-11 13:51:47 +00:00
PlatformScreen::setHalfDuplexMask(KeyModifierMask mask)
2012-06-10 16:50:54 +00:00
{
getKeyState()->setHalfDuplexMask(mask);
}
void
2014-11-11 13:51:47 +00:00
PlatformScreen::fakeKeyDown(KeyID id, KeyModifierMask mask,
2012-06-10 16:50:54 +00:00
KeyButton button)
{
getKeyState()->fakeKeyDown(id, mask, button);
}
bool
2014-11-11 13:51:47 +00:00
PlatformScreen::fakeKeyRepeat(KeyID id, KeyModifierMask mask,
2012-06-10 16:50:54 +00:00
SInt32 count, KeyButton button)
{
return getKeyState()->fakeKeyRepeat(id, mask, count, button);
}
bool
2014-11-11 13:51:47 +00:00
PlatformScreen::fakeKeyUp(KeyButton button)
2012-06-10 16:50:54 +00:00
{
return getKeyState()->fakeKeyUp(button);
}
void
2014-11-11 13:51:47 +00:00
PlatformScreen::fakeAllKeysUp()
2012-06-10 16:50:54 +00:00
{
getKeyState()->fakeAllKeysUp();
}
bool
2014-11-11 13:51:47 +00:00
PlatformScreen::fakeCtrlAltDel()
2012-06-10 16:50:54 +00:00
{
return getKeyState()->fakeCtrlAltDel();
}
bool
2014-11-11 13:51:47 +00:00
PlatformScreen::isKeyDown(KeyButton button) const
2012-06-10 16:50:54 +00:00
{
return getKeyState()->isKeyDown(button);
}
KeyModifierMask
2014-11-11 13:51:47 +00:00
PlatformScreen::getActiveModifiers() const
2012-06-10 16:50:54 +00:00
{
return getKeyState()->getActiveModifiers();
}
KeyModifierMask
2014-11-11 13:51:47 +00:00
PlatformScreen::pollActiveModifiers() const
2012-06-10 16:50:54 +00:00
{
return getKeyState()->pollActiveModifiers();
}
SInt32
2014-11-11 13:51:47 +00:00
PlatformScreen::pollActiveGroup() const
2012-06-10 16:50:54 +00:00
{
return getKeyState()->pollActiveGroup();
}
void
2014-11-11 13:51:47 +00:00
PlatformScreen::pollPressedKeys(KeyButtonSet& pressedKeys) const
2012-06-10 16:50:54 +00:00
{
getKeyState()->pollPressedKeys(pressedKeys);
}
bool
2014-11-11 13:51:47 +00:00
PlatformScreen::isDraggingStarted()
{
2014-11-11 13:51:47 +00:00
if (App::instance().argsBase().m_enableDragDrop) {
return m_draggingStarted;
}
return false;
}