removed getEventMask() and fixed some comments. also now using
toggle key states in updateModifiers().
This commit is contained in:
parent
f8eb775278
commit
7cf20d9ad0
|
@ -310,6 +310,7 @@ void CXWindowsSecondaryScreen::onOpenDisplay()
|
||||||
CWDontPropagate | CWEventMask |
|
CWDontPropagate | CWEventMask |
|
||||||
CWOverrideRedirect | CWCursor,
|
CWOverrideRedirect | CWCursor,
|
||||||
&attr);
|
&attr);
|
||||||
|
log((CLOG_DEBUG "window is 0x%08x", m_window));
|
||||||
|
|
||||||
// become impervious to server grabs
|
// become impervious to server grabs
|
||||||
XTestGrabControl(display, True);
|
XTestGrabControl(display, True);
|
||||||
|
@ -345,14 +346,6 @@ void CXWindowsSecondaryScreen::onLostClipboard(
|
||||||
m_client->onClipboardChanged(id);
|
m_client->onClipboardChanged(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
long CXWindowsSecondaryScreen::getEventMask(Window w) const
|
|
||||||
{
|
|
||||||
if (w == m_window)
|
|
||||||
return LeaveWindowMask;
|
|
||||||
else
|
|
||||||
return NoEventMask;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CXWindowsSecondaryScreen::leaveNoLock(Display* display)
|
void CXWindowsSecondaryScreen::leaveNoLock(Display* display)
|
||||||
{
|
{
|
||||||
assert(display != NULL);
|
assert(display != NULL);
|
||||||
|
@ -778,7 +771,7 @@ void CXWindowsSecondaryScreen::doKeystrokes(
|
||||||
unsigned int CXWindowsSecondaryScreen::maskToX(
|
unsigned int CXWindowsSecondaryScreen::maskToX(
|
||||||
KeyModifierMask inMask) const
|
KeyModifierMask inMask) const
|
||||||
{
|
{
|
||||||
// FIXME -- should be configurable. not using Mod3Mask.
|
// FIXME -- should be configurable. also not using Mod3Mask.
|
||||||
unsigned int outMask = 0;
|
unsigned int outMask = 0;
|
||||||
if (inMask & KeyModifierShift)
|
if (inMask & KeyModifierShift)
|
||||||
outMask |= ShiftMask;
|
outMask |= ShiftMask;
|
||||||
|
@ -817,8 +810,17 @@ void CXWindowsSecondaryScreen::updateKeys(Display* display)
|
||||||
}
|
}
|
||||||
|
|
||||||
void CXWindowsSecondaryScreen::updateModifiers(
|
void CXWindowsSecondaryScreen::updateModifiers(
|
||||||
Display*)
|
Display* display)
|
||||||
{
|
{
|
||||||
|
// query the pointer to get the keyboard state
|
||||||
|
Window root, window;
|
||||||
|
int xRoot, yRoot, xWindow, yWindow;
|
||||||
|
unsigned int state;
|
||||||
|
if (!XQueryPointer(display, m_window, &root, &window,
|
||||||
|
&xRoot, &yRoot, &xWindow, &yWindow, &state)) {
|
||||||
|
state = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// update active modifier mask
|
// update active modifier mask
|
||||||
m_mask = 0;
|
m_mask = 0;
|
||||||
for (unsigned int i = 0; i < 8; ++i) {
|
for (unsigned int i = 0; i < 8; ++i) {
|
||||||
|
@ -829,8 +831,9 @@ void CXWindowsSecondaryScreen::updateModifiers(
|
||||||
m_mask |= bit;
|
m_mask |= bit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if ((bit & state) != 0) {
|
||||||
// FIXME -- not sure how to check current lock states
|
// toggle is on
|
||||||
|
m_mask |= bit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ protected:
|
||||||
createClipboard(ClipboardID);
|
createClipboard(ClipboardID);
|
||||||
virtual void onCloseDisplay();
|
virtual void onCloseDisplay();
|
||||||
virtual void onLostClipboard(ClipboardID);
|
virtual void onLostClipboard(ClipboardID);
|
||||||
virtual long getEventMask(Window) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum EKeyAction { kPress, kRelease, kRepeat };
|
enum EKeyAction { kPress, kRelease, kRepeat };
|
||||||
|
|
Loading…
Reference in New Issue