[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/kimmoli/tohkbd2.git</param>
<param name="branch">master</param>
- <param name="revision">002eacfbd359dbd05dd35e0eb9fc7465b8e944ca</param>
+ <param name="revision">ce231cdece601ab2dc57df59a32865a67883403a</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.8.1.tar.bz2/daemon/src/keymapping.cpp
^
|
@@ -56,6 +56,14 @@
while ((j = ir.indexOf((char)0x00)) != -1)
ir.remove(j, 1);
+ for (j=0; j<ir.length(); j++) /* Quickly check does input report contain bogus */
+ if (ir.at(j) < 0xa0)
+ {
+ printf("keymap: bogus value on input report detected. Resetting TCA\n");
+ emit bogusDetected();
+ return;
+ }
+
/* First check modifiers from modifier byte */
if (inputReport.at(3) & 0x02) symDown = true;
if (inputReport.at(3) & 0x08) ctrlDown = true;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.8.1.tar.bz2/daemon/src/keymapping.h
^
|
@@ -44,6 +44,7 @@
void keyPressed(QList< QPair<int, int> > keyCode);
void keyReleased();
void toggleCapsLock();
+ void bogusDetected();
public slots:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.8.1.tar.bz2/daemon/src/tca8424driver.h
^
|
@@ -19,7 +19,6 @@
public:
explicit tca8424driver(unsigned char address);
- bool reset();
void setLeds(int value);
QByteArray readInputReport();
@@ -35,6 +34,7 @@
signals:
public slots:
+ bool reset();
private:
void init();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.8.1.tar.bz2/daemon/src/tohkeyboard.cpp
^
|
@@ -122,7 +122,7 @@
connect(keymap, SIGNAL(toggleCapsLock()), this, SLOT(toggleCapsLock()));
connect(keymap, SIGNAL(keyPressed(QList< QPair<int, int> >)), this, SLOT(handleKeyPressed(QList< QPair<int, int> >)));
connect(keymap, SIGNAL(keyReleased()), this, SLOT(handleKeyReleased()));
-
+ connect(keymap, SIGNAL(bogusDetected()), tca8424, SLOT(reset()));
}
/* Remove uinput device, stop threads and unregister from dbus
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.8.1.tar.bz2/settings-ui/qml/components/KeyboardHandler.qml
^
|
@@ -73,16 +73,14 @@
/* When using SilicaFlickable and Repeater in Column, this moves flickable so selected item should be visible.
* For softer movement, add e.g. following to SilicaFlickable
* Behavior on contentY { NumberAnimation { duration: 200 } }
+ *
+ * Thanks for refractoring, xkr47
*/
- function flickRepeaterMover(flick, repeater, pageheader, page)
+ function flickRepeaterMover(flick, repeater)
{
var itm = repeater.itemAt(upDownSelection)
-
- if ((itm.y + itm.height) - flick.contentY > page.height)
- flick.contentY = itm.y - ((page.height / itm.height) -1 ) * itm.height
-
- if ((itm.y < flick.contentY))
- flick.contentY = itm.y - pageheader.height
+ var minY = itm.y + itm.height - flick.height
+ var maxY = itm.y - repeater.itemAt(0).y
+ flick.contentY = Math.min(maxY, Math.max(minY, flick.contentY))
}
-
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.8.1.tar.bz2/settings-ui/qml/pages/Shortcuts.qml
^
|
@@ -16,8 +16,8 @@
{
id: kbdif
upDownItemCount: shortcutsModel.count
- onKeyUpPressed: flickRepeaterMover(flick, repeater, pageheader, page)
- onKeyDownPressed: flickRepeaterMover(flick, repeater, pageheader, page)
+ onKeyUpPressed: flickRepeaterMover(flick, repeater)
+ onKeyDownPressed: flickRepeaterMover(flick, repeater)
onKeyEnterPressed:
{
pageStack.push(appSelector, {"keyId": shortcutsModel.get(upDownSelection).key})
|