X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=qml%2FQZeeControl%2FZeeRemoteControl.qml;fp=qml%2FQZeeControl%2FZeeRemoteControl.qml;h=04d7c786d5e1cb7c9aa07c476f7e0991526b666a;hb=e920ac25587c317e7ed3cb694e2df2b462fa5b3a;hp=0000000000000000000000000000000000000000;hpb=8617190512551bc2f079bd29248a62b1d4b5f064;p=qzeecontrol diff --git a/qml/QZeeControl/ZeeRemoteControl.qml b/qml/QZeeControl/ZeeRemoteControl.qml new file mode 100644 index 0000000..04d7c78 --- /dev/null +++ b/qml/QZeeControl/ZeeRemoteControl.qml @@ -0,0 +1,61 @@ +/* + * Copyright 2012 Ruediger Gad + * + * This file is part of QZeeControl. + * + * QZeeControl is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * QZeeControl 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 QZeeControl. If not, see . + */ + +import QtQuick 1.1 +import qzeecontrol 1.0 + +BtConnector{ + id: zeeRemoteControl + + /* + * Keybindings + */ + property string keyBindingA + property string keyBindingB + property string keyBindingC + property string keyBindingD + + property string keyBindingUp + property string keyBindingDown + property string keyBindingLeft + property string keyBindingRight + +// Examples on how to use these old signals. +// onStickMoved: { +// console.log("Stick moved. x: " + x + " y: " + y) +// } +// onButtonsChanged: { +// console.log("Buttons changed. A: " + a + " B: " + b + " C: " + c + " D: " + d) +// } + + /* + * Do the actual keyboard interaction. + */ + onAChanged: xtstAdapter.sendKey(keyBindingA, val); + onBChanged: xtstAdapter.sendKey(keyBindingB, val); + onCChanged: xtstAdapter.sendKey(keyBindingC, val); + onDChanged: xtstAdapter.sendKey(keyBindingD, val); + + onUpChanged: xtstAdapter.sendKey(keyBindingUp, val) + onDownChanged: xtstAdapter.sendKey(keyBindingDown, val) + onLeftChanged: xtstAdapter.sendKey(keyBindingLeft, val) + onRightChanged: xtstAdapter.sendKey(keyBindingRight, val) +} + +