[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:28:11 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=127a117
The following commit has been merged in the master branch:
commit 127a117c62f47177462b193cd2859324e3ac6188
Author: Albert Vaca <albertvaka at gmail.com>
Date: Tue Jan 6 00:11:58 2015 -0800
Added support for Ctrl, Alt and Shift combinations and F keys to keyboard.
---
plugins/mousepad/mousepadplugin.cpp | 44 ++++++++++++++++++++++++++++++++++---
1 file changed, 41 insertions(+), 3 deletions(-)
diff --git a/plugins/mousepad/mousepadplugin.cpp b/plugins/mousepad/mousepadplugin.cpp
index 9a8b489..cf5f70e 100644
--- a/plugins/mousepad/mousepadplugin.cpp
+++ b/plugins/mousepad/mousepadplugin.cpp
@@ -53,6 +53,24 @@ int SpecialKeysMap[] = {
XK_Return, // 12
XK_Delete, // 13
XK_Escape, // 14
+ XK_Sys_Req, // 15
+ XK_Scroll_Lock, // 16
+ 0, // 17
+ 0, // 18
+ 0, // 19
+ 0, // 20
+ XK_F1, // 21
+ XK_F2, // 22
+ XK_F3, // 23
+ XK_F4, // 24
+ XK_F5, // 25
+ XK_F6, // 26
+ XK_F7, // 27
+ XK_F8, // 28
+ XK_F9, // 29
+ XK_F10, // 30
+ XK_F11, // 31
+ XK_F12, // 32
};
template <typename T, size_t N>
@@ -78,7 +96,9 @@ MousepadPlugin::~MousepadPlugin()
bool MousepadPlugin::receivePackage(const NetworkPackage& np)
{
- //TODO: Split mouse/keyboard in two different plugins to avoid big if statements
+ //qDebug() << np.serialize();
+
+ //TODO: Split mouse/keyboard in two different plugins to avoid this big if statement
float dx = np.get<float>("dx", 0);
float dy = np.get<float>("dy", 0);
@@ -88,6 +108,7 @@ bool MousepadPlugin::receivePackage(const NetworkPackage& np)
bool isMiddleClick = np.get<bool>("middleclick", false);
bool isRightClick = np.get<bool>("rightclick", false);
bool isSingleHold = np.get<bool>("singlehold", false);
+ bool isSingleRelease = np.get<bool>("singlerelease", false);
bool isScroll = np.get<bool>("scroll", false);
QString key = np.get<QString>("key", "");
int specialKey = np.get<int>("specialKey", 0);
@@ -117,8 +138,12 @@ bool MousepadPlugin::receivePackage(const NetworkPackage& np)
XTestFakeButtonEvent(m_display, RightMouseButton, True, 0);
XTestFakeButtonEvent(m_display, RightMouseButton, False, 0);
} else if (isSingleHold){
- XTestFakeButtonEvent(m_display, LeftMouseButton, True, 0);
- }else if( isScroll ) {
+ //For drag'n drop
+ XTestFakeButtonEvent(m_display, LeftMouseButton, True, 0);
+ } else if (isSingleRelease){
+ //For drag'n drop. NEVER USED (release is done by tapping, which actually triggers a isSingleClick). Kept here for future-proofnes.
+ XTestFakeButtonEvent(m_display, LeftMouseButton, False, 0);
+ } else if (isScroll) {
if (dy < 0) {
XTestFakeButtonEvent(m_display, MouseWheelDown, True, 0);
XTestFakeButtonEvent(m_display, MouseWheelDown, False, 0);
@@ -128,6 +153,14 @@ bool MousepadPlugin::receivePackage(const NetworkPackage& np)
}
} else if (!key.isEmpty() || specialKey) {
+ bool ctrl = np.get<bool>("ctrl", false);
+ bool alt = np.get<bool>("alt", false);
+ bool shift = np.get<bool>("shift", false);
+
+ if (ctrl) XTestFakeKeyEvent (m_display, XKeysymToKeycode(m_display, XK_Control_L), True, 0);
+ if (alt) XTestFakeKeyEvent (m_display, XKeysymToKeycode(m_display, XK_Alt_L), True, 0);
+ if (shift) XTestFakeKeyEvent (m_display, XKeysymToKeycode(m_display, XK_Shift_L), True, 0);
+
if (specialKey)
{
if (specialKey > (int)arraySize(SpecialKeysMap)) {
@@ -136,6 +169,7 @@ bool MousepadPlugin::receivePackage(const NetworkPackage& np)
}
int keycode = XKeysymToKeycode(m_display, SpecialKeysMap[specialKey]);
+
XTestFakeKeyEvent (m_display, keycode, True, 0);
XTestFakeKeyEvent (m_display, keycode, False, 0);
@@ -154,6 +188,10 @@ bool MousepadPlugin::receivePackage(const NetworkPackage& np)
fakekey_release(m_fakekey);
}
+ if (ctrl) XTestFakeKeyEvent (m_display, XKeysymToKeycode(m_display, XK_Control_L), False, 0);
+ if (alt) XTestFakeKeyEvent (m_display, XKeysymToKeycode(m_display, XK_Alt_L), False, 0);
+ if (shift) XTestFakeKeyEvent (m_display, XKeysymToKeycode(m_display, XK_Shift_L), False, 0);
+
}
XFlush(m_display);
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list