From 0d36b76b3960f1e26132404e72233d24b48beb5f Mon Sep 17 00:00:00 2001 From: Thomas Pietrzak Date: Wed, 14 Mar 2012 09:04:34 +0000 Subject: [PATCH] Widget keyboard initial import git-svn-id: svn+ssh://thomaspietrzak.com/var/svn/rep@60 47cf9a05-e0a8-4ed5-9e9b-101a649bc004 --- KeyboardDebug/KeyboardDebug.sln | 20 + KeyboardDebug/KeyboardDebug.suo | Bin 0 -> 14848 bytes .../KeyboardDebug/KeyboardDebug.vcxproj | 144 + .../KeyboardDebug.vcxproj.filters | 70 + KeyboardDebug/KeyboardDebug/keyboarddebug.cpp | 110 + KeyboardDebug/KeyboardDebug/keyboarddebug.h | 29 + KeyboardDebug/KeyboardDebug/keyboarddebug.qrc | 4 + KeyboardDebug/KeyboardDebug/keyboarddebug.ui | 160 + KeyboardDebug/KeyboardDebug/main.cpp | 10 + WidgetKeyboard.sln | 20 + WidgetKeyboard.suo | Bin 0 -> 14848 bytes WidgetKeyboard/WidgetKeyboard.pro | 5 + WidgetKeyboard/WidgetKeyboard.suo | Bin 0 -> 22016 bytes WidgetKeyboard/WidgetKeyboard.vcxproj | 248 ++ WidgetKeyboard/WidgetKeyboard.vcxproj.filters | 138 + WidgetKeyboard/WidgetKeyboard.vcxproj.user | 10 + WidgetKeyboard/blue.png | Bin 0 -> 4522 bytes WidgetKeyboard/common.pri | 9 + WidgetKeyboard/example/DynaKeyboard.cpp | 73 + WidgetKeyboard/example/DynaKeyboard.h | 33 + WidgetKeyboard/example/DynaKeyboardHaptic.cpp | 21 + WidgetKeyboard/example/DynaKeyboardHaptic.h | 22 + WidgetKeyboard/example/DynaKeyboardVisual.cpp | 101 + WidgetKeyboard/example/DynaKeyboardVisual.h | 41 + WidgetKeyboard/example/Main.cpp | 43 + WidgetKeyboard/example/MenuBar.cpp | 10 + WidgetKeyboard/example/Sheet.cpp | 301 ++ WidgetKeyboard/example/Sheet.h | 73 + WidgetKeyboard/example/UseKeyBoardDialog.cpp | 43 + WidgetKeyboard/example/UseKeyBoardDialog.h | 41 + WidgetKeyboard/example/UseKeyBoardDialog.ui | 87 + WidgetKeyboard/example/example.pro | 21 + WidgetKeyboard/grey.png | Bin 0 -> 4153 bytes WidgetKeyboard/ressource.qrc | 6 + WidgetKeyboard/src/WidgetKeyboard.cpp | 413 +++ WidgetKeyboard/src/WidgetKeyboard.h | 69 + WidgetKeyboard/src/WidgetKeyboard.pri | 18 + WidgetKeyboard/src/WidgetKeyboard.qrc | 8 + WidgetKeyboard/src/WidgetKeyboard.ui | 2654 +++++++++++++++++ WidgetKeyboard/src/res/down.JPG | Bin 0 -> 937 bytes WidgetKeyboard/src/res/left.JPG | Bin 0 -> 929 bytes WidgetKeyboard/src/res/right.JPG | Bin 0 -> 934 bytes WidgetKeyboard/src/res/up.JPG | Bin 0 -> 929 bytes 43 files changed, 5055 insertions(+) create mode 100644 KeyboardDebug/KeyboardDebug.sln create mode 100644 KeyboardDebug/KeyboardDebug.suo create mode 100644 KeyboardDebug/KeyboardDebug/KeyboardDebug.vcxproj create mode 100644 KeyboardDebug/KeyboardDebug/KeyboardDebug.vcxproj.filters create mode 100644 KeyboardDebug/KeyboardDebug/keyboarddebug.cpp create mode 100644 KeyboardDebug/KeyboardDebug/keyboarddebug.h create mode 100644 KeyboardDebug/KeyboardDebug/keyboarddebug.qrc create mode 100644 KeyboardDebug/KeyboardDebug/keyboarddebug.ui create mode 100644 KeyboardDebug/KeyboardDebug/main.cpp create mode 100644 WidgetKeyboard.sln create mode 100644 WidgetKeyboard.suo create mode 100644 WidgetKeyboard/WidgetKeyboard.pro create mode 100644 WidgetKeyboard/WidgetKeyboard.suo create mode 100644 WidgetKeyboard/WidgetKeyboard.vcxproj create mode 100644 WidgetKeyboard/WidgetKeyboard.vcxproj.filters create mode 100644 WidgetKeyboard/WidgetKeyboard.vcxproj.user create mode 100644 WidgetKeyboard/blue.png create mode 100644 WidgetKeyboard/common.pri create mode 100644 WidgetKeyboard/example/DynaKeyboard.cpp create mode 100644 WidgetKeyboard/example/DynaKeyboard.h create mode 100644 WidgetKeyboard/example/DynaKeyboardHaptic.cpp create mode 100644 WidgetKeyboard/example/DynaKeyboardHaptic.h create mode 100644 WidgetKeyboard/example/DynaKeyboardVisual.cpp create mode 100644 WidgetKeyboard/example/DynaKeyboardVisual.h create mode 100644 WidgetKeyboard/example/Main.cpp create mode 100644 WidgetKeyboard/example/MenuBar.cpp create mode 100644 WidgetKeyboard/example/Sheet.cpp create mode 100644 WidgetKeyboard/example/Sheet.h create mode 100644 WidgetKeyboard/example/UseKeyBoardDialog.cpp create mode 100644 WidgetKeyboard/example/UseKeyBoardDialog.h create mode 100644 WidgetKeyboard/example/UseKeyBoardDialog.ui create mode 100644 WidgetKeyboard/example/example.pro create mode 100644 WidgetKeyboard/grey.png create mode 100644 WidgetKeyboard/ressource.qrc create mode 100644 WidgetKeyboard/src/WidgetKeyboard.cpp create mode 100644 WidgetKeyboard/src/WidgetKeyboard.h create mode 100644 WidgetKeyboard/src/WidgetKeyboard.pri create mode 100644 WidgetKeyboard/src/WidgetKeyboard.qrc create mode 100644 WidgetKeyboard/src/WidgetKeyboard.ui create mode 100644 WidgetKeyboard/src/res/down.JPG create mode 100644 WidgetKeyboard/src/res/left.JPG create mode 100644 WidgetKeyboard/src/res/right.JPG create mode 100644 WidgetKeyboard/src/res/up.JPG diff --git a/KeyboardDebug/KeyboardDebug.sln b/KeyboardDebug/KeyboardDebug.sln new file mode 100644 index 0000000..8f43f7d --- /dev/null +++ b/KeyboardDebug/KeyboardDebug.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeyboardDebug", "KeyboardDebug\KeyboardDebug.vcxproj", "{CB081BF4-9013-44A0-901D-E9B91F0DF953}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CB081BF4-9013-44A0-901D-E9B91F0DF953}.Debug|Win32.ActiveCfg = Debug|Win32 + {CB081BF4-9013-44A0-901D-E9B91F0DF953}.Debug|Win32.Build.0 = Debug|Win32 + {CB081BF4-9013-44A0-901D-E9B91F0DF953}.Release|Win32.ActiveCfg = Release|Win32 + {CB081BF4-9013-44A0-901D-E9B91F0DF953}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/KeyboardDebug/KeyboardDebug.suo b/KeyboardDebug/KeyboardDebug.suo new file mode 100644 index 0000000000000000000000000000000000000000..def15fb4b5c36f10181011c7ef658701a20e3377 GIT binary patch literal 14848 zcmeHNTZ|i589q*$c9W(+nlyy8O`S9ixvX7#?M<^uw#oXkX_{?7ONKin4gv3SA@O@|ItjG3x zJiGShf^w|ibLPyM^Z(~R|M_ocE?-*p&X-Ka*dO8msP6rJ{OuzHRFqb^Q}gTOw4T2h>L8=~RaT4*6BM;kgcX`mdljES@`#FRKJ z^0=Df2>vzDq}mOuThsr|Vu|lQJf+N&j;0+Q52!O0uhjfCkp=bya2udx65Jpat&1P{ ziI@A%D}JZGR{N4y>H(z#c)t(#N(ZQZ)B|e&lZR^mQx{MNkdFNT?tk@89Chk|djR(W zxb)=~woKQ|p z`+geNQvmKHK6fkKkG>taxb$lWFFf%2gP(kL^a5U)SNUt45^@cT54br&URhSsD|vd{ zNNAbLEt!&`FKO73mU$;MADVUYA)?d^rW;tEx_K#FD zg?#pqc4kbU(u)0=P-LQa;-QIfIM*9WN7A=RWD4Ugm7#pLtQ-1-863|Wm2_d$tmN`~ zP?9jIm1iqsx?VV%FXr@9Mlg{!(_{IP5gf@Ei|I^3lQ+rJrdBlanS3E{o(YbSQUfhn zZO36*(aL;p)YQuw=XtyIzeosW`Us@;F-Tz;J7BBSXK~07HOmzKb7-reH3(S=i*5M% z#a`?$18>j<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d00001 diff --git a/KeyboardDebug/KeyboardDebug/KeyboardDebug.vcxproj b/KeyboardDebug/KeyboardDebug/KeyboardDebug.vcxproj new file mode 100644 index 0000000..65ac718 --- /dev/null +++ b/KeyboardDebug/KeyboardDebug/KeyboardDebug.vcxproj @@ -0,0 +1,144 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {CB081BF4-9013-44A0-901D-E9B91F0DF953} + Qt4VSv1.0 + + + + Application + + + Application + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + AllRules.ruleset + + + AllRules.ruleset + + + $(SolutionDir)$(ConfigurationName) + $(SolutionDir)$(ConfigurationName) + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + DynamicKeyboardLibrary.lib;qtmaind.lib;QtCored4.lib;QtGuid4.lib;%(AdditionalDependencies) + + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) + + + MultiThreadedDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + false + DynamicKeyboardLibrary.lib;qtmain.lib;QtCore4.lib;QtGui4.lib;%(AdditionalDependencies) + + + + + true + + + + + + + + + true + + + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "keyboarddebug.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "keyboarddebug.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + + + + Document + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + + + + + + + + + + + \ No newline at end of file diff --git a/KeyboardDebug/KeyboardDebug/KeyboardDebug.vcxproj.filters b/KeyboardDebug/KeyboardDebug/KeyboardDebug.vcxproj.filters new file mode 100644 index 0000000..5e0432e --- /dev/null +++ b/KeyboardDebug/KeyboardDebug/KeyboardDebug.vcxproj.filters @@ -0,0 +1,70 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;cxx;c;def + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + moc;h;cpp + False + + + {447a3b5f-957b-4b68-a79d-a07b726434e0} + cpp;moc + False + + + {e5b2149f-c711-4349-a902-c1554c9309a8} + cpp;moc + False + + + + + Source Files + + + Source Files + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files + + + + + Header Files + + + Form Files + + + Resource Files + + + + + Generated Files + + + \ No newline at end of file diff --git a/KeyboardDebug/KeyboardDebug/keyboarddebug.cpp b/KeyboardDebug/KeyboardDebug/keyboarddebug.cpp new file mode 100644 index 0000000..274757b --- /dev/null +++ b/KeyboardDebug/KeyboardDebug/keyboarddebug.cpp @@ -0,0 +1,110 @@ +#include "keyboarddebug.h" + +#include + +KeyboardDebug::KeyboardDebug(QWidget *parent, Qt::WFlags flags) + : QMainWindow(parent, flags) +{ + ui.setupUi(this); + try + { + _keyboardController = new DynamicKeyboardController("COM5", 115200); + getState(); + } + catch (...) + { + qDebug() << "Could not locate the Arduino board" << endl; + _keyboardController = NULL; + } + + + QObject::connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(setConfiguration())); + QObject::connect(ui.getState, SIGNAL(clicked()), this, SLOT(getState())); + + QObject::connect(ui.minDutyCycle, SIGNAL(valueChanged(int)), this, SLOT(setMinDutyCycle(int))); + QObject::connect(ui.maxDutyCycle, SIGNAL(valueChanged(int)), this, SLOT(setMaxDutyCycle(int))); + QObject::connect(ui.boostDuration, SIGNAL(valueChanged(int)), this, SLOT(setBoostDuration(int))); + + QObject::connect(ui.s1, SIGNAL(stateChanged(int)), this, SLOT(setConfiguration(int))); + QObject::connect(ui.s2, SIGNAL(stateChanged(int)), this, SLOT(setConfiguration(int))); + QObject::connect(ui.s3, SIGNAL(stateChanged(int)), this, SLOT(setConfiguration(int))); + QObject::connect(ui.s4, SIGNAL(stateChanged(int)), this, SLOT(setConfiguration(int))); + QObject::connect(ui.s5, SIGNAL(stateChanged(int)), this, SLOT(setConfiguration(int))); + QObject::connect(ui.s6, SIGNAL(stateChanged(int)), this, SLOT(setConfiguration(int))); + QObject::connect(ui.s7, SIGNAL(stateChanged(int)), this, SLOT(setConfiguration(int))); + QObject::connect(ui.s8, SIGNAL(stateChanged(int)), this, SLOT(setConfiguration(int))); +} + +KeyboardDebug::~KeyboardDebug() +{ + +} + +inline bool isChecked(QCheckBox *c) +{ + bool a = c->checkState() > 0; + return c->checkState() > 0; +} + +void KeyboardDebug::setConfiguration() +{ + if (!_keyboardController) + return; + + UINT16 config = + UINT16(isChecked(ui.s1)) << 15 + | UINT16(isChecked(ui.s2)) << 14 + | UINT16(isChecked(ui.s3)) << 13 + | UINT16(isChecked(ui.s4)) << 12 + | UINT16(isChecked(ui.s5)) << 11 + | UINT16(isChecked(ui.s6)) << 10 + | UINT16(isChecked(ui.s7)) << 9 + | UINT16(isChecked(ui.s8)) << 8; + + qDebug() << hex << config << endl; + _keyboardController->setConfiguration(config); +} + +void KeyboardDebug::setConfiguration(int) +{ + setConfiguration(); +} + +void KeyboardDebug::setMinDutyCycle(int a) +{ + if (_keyboardController) + _keyboardController->setMinimumDutyCycle(UINT8(a)); +} + +void KeyboardDebug::setMaxDutyCycle(int a) +{ + if (_keyboardController) + _keyboardController->setMaximumDutyCycle(UINT8(a)); +} + +void KeyboardDebug::setBoostDuration(int a) +{ + if (_keyboardController) + _keyboardController->setBoostDuration(UINT16(a)); +} + +void KeyboardDebug::getState() +{ + UINT16 solenoids, duration; + UINT8 min, max; + if (_keyboardController) + _keyboardController->getState(solenoids, min, max, duration); + + ui.s1->setChecked(solenoids & 0x8000); + ui.s2->setChecked(solenoids & 0x4000); + ui.s3->setChecked(solenoids & 0x2000); + ui.s4->setChecked(solenoids & 0x1000); + ui.s5->setChecked(solenoids & 0x0800); + ui.s6->setChecked(solenoids & 0x0400); + ui.s7->setChecked(solenoids & 0x0200); + ui.s8->setChecked(solenoids & 0x0100); + + ui.minDutyCycle->setValue(min); + ui.maxDutyCycle->setValue(max); + ui.boostDuration->setValue(duration); +} diff --git a/KeyboardDebug/KeyboardDebug/keyboarddebug.h b/KeyboardDebug/KeyboardDebug/keyboarddebug.h new file mode 100644 index 0000000..59869e4 --- /dev/null +++ b/KeyboardDebug/KeyboardDebug/keyboarddebug.h @@ -0,0 +1,29 @@ +#ifndef KEYBOARDDEBUG_H +#define KEYBOARDDEBUG_H + +#include +#include "ui_keyboarddebug.h" + +#include + +class KeyboardDebug : public QMainWindow +{ + Q_OBJECT + +public: + KeyboardDebug(QWidget *parent = 0, Qt::WFlags flags = 0); + ~KeyboardDebug(); + + public slots: + void setConfiguration(); + void setConfiguration(int); + void setMinDutyCycle(int); + void setMaxDutyCycle(int); + void setBoostDuration(int); + void getState(); +private: + Ui::KeyboardDebugClass ui; + DynamicKeyboardController *_keyboardController; +}; + +#endif // KEYBOARDDEBUG_H diff --git a/KeyboardDebug/KeyboardDebug/keyboarddebug.qrc b/KeyboardDebug/KeyboardDebug/keyboarddebug.qrc new file mode 100644 index 0000000..cd1413f --- /dev/null +++ b/KeyboardDebug/KeyboardDebug/keyboarddebug.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/KeyboardDebug/KeyboardDebug/keyboarddebug.ui b/KeyboardDebug/KeyboardDebug/keyboarddebug.ui new file mode 100644 index 0000000..678cec6 --- /dev/null +++ b/KeyboardDebug/KeyboardDebug/keyboarddebug.ui @@ -0,0 +1,160 @@ + + + KeyboardDebugClass + + + + 0 + 0 + 576 + 391 + + + + KeyboardDebug + + + + + + 110 + 50 + 421 + 311 + + + + + + + Solenoid 1 + + + + + + + Solenoid 2 + + + + + + + Solenoid 3 + + + + + + + Solenoid 4 + + + + + + + Solenoid 5 + + + + + + + Solenoid 6 + + + + + + + Solenoid 7 + + + + + + + Solenoid 8 + + + + + + + Test + + + + + + + 255 + + + 80 + + + + + + + 255 + + + 255 + + + + + + + 10000 + + + 10 + + + 200 + + + + + + + Min duty cycle + + + + + + + Max duty cycle + + + + + + + Boost Duration + + + + + + + Get state + + + + + + + + + + + + + diff --git a/KeyboardDebug/KeyboardDebug/main.cpp b/KeyboardDebug/KeyboardDebug/main.cpp new file mode 100644 index 0000000..4749db5 --- /dev/null +++ b/KeyboardDebug/KeyboardDebug/main.cpp @@ -0,0 +1,10 @@ +#include "keyboarddebug.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + KeyboardDebug w; + w.show(); + return a.exec(); +} diff --git a/WidgetKeyboard.sln b/WidgetKeyboard.sln new file mode 100644 index 0000000..86e6073 --- /dev/null +++ b/WidgetKeyboard.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WidgetKeyboard", "WidgetKeyboard\WidgetKeyboard.vcxproj", "{2B394A83-C563-419A-BECF-A6EE41EB5BE5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2B394A83-C563-419A-BECF-A6EE41EB5BE5}.Debug|Win32.ActiveCfg = Debug|Win32 + {2B394A83-C563-419A-BECF-A6EE41EB5BE5}.Debug|Win32.Build.0 = Debug|Win32 + {2B394A83-C563-419A-BECF-A6EE41EB5BE5}.Release|Win32.ActiveCfg = Release|Win32 + {2B394A83-C563-419A-BECF-A6EE41EB5BE5}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/WidgetKeyboard.suo b/WidgetKeyboard.suo new file mode 100644 index 0000000000000000000000000000000000000000..85b165cefc39c5852bf6db1f5f69e2de23cd9173 GIT binary patch literal 14848 zcmeHNU5p!76~4|-f6~&D6hab0>Xf9U$=dO**V{NDCH_nE+ude2n?g;<*q(K~>v$Y{ zyxDCw5)u!H7ZAMg^MF)9KzO1E0YVi5K`WFZ1*uYn3P`O~UO=i4Jn+G%!umnJxqvDz6!Bse%9j~YL zT%$Nr)9ZT0)Xb7m8PW1nT2b!{j_b8L?hp1y!q%@Zm}->GMom9h(Hmw>EB6IQ8o6>Q ze_Wp(Gp6*)!CWLd5u12&qQAcoi)c~pUW=HbxTbNkl&=|eW5NuNm+B3zJZd%yB_nLH zP}FPl7h{G|K2xd`j7#-!S~In=Qnel)DOD<3uB=-(nHf{B)JwTixn$0UN62X%HFwC2LH1fUC0fm z!MnF?WncOlmNC$&!jkCi==tb_b!a$g(;H61!XuXT%l_`;ZqTPcp)c}FpZqFDNh1fV zDdI;S&cGr~P(P2mPQIVK!2eowNt=aroeI}U`briz{UmtM!NU}!Vn7~TlfC%Zh4E9C z^vQndbM2u|V4)JzpQOZok)2=t>bRy>m_Qah8jwf>zK1hIezHIfbv#d_u7H*TxRn}| zg%nG;r$kMRM28n*i-uKoPSc8dcj?KUwbukQN(JO@`pEYq-(h%aS zx19&-YZ;@Qu;)Y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eU(PDye|J)z z`>Eh09+-~eFgS#p^eNad)L0J9qengADPdVoUC8JR8$M#>C{7;5{&upn z-rXu}d~@vZmexPnFZAWgeKCHm24i>sc>VsL1$#Rs^DXPerwV?*z4fos^Y0za3DsW) z=6}0VLdx`4>*@R1|Es{x@9%EknZEt+>+k$6>W;sG?p>0II9e7o7_Ht#A}TA}NA)n6_7d!EaNH|}r0 z{`HbRzqO{G2D8D_q|DQ_r$|qn?#MDv3!cVPmVUYhDiGe--z5L>mP`9u@wR>7U5(6> zx@|UiXCU(epGp} + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + true + + + true + + + true + + + true + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\example" "-I.\src" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "src\WidgetKeyboard.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\example" "-I.\src" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "src\WidgetKeyboard.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + + + + + Document + %(FullPath);.\src\res\down.JPG;.\src\res\left.JPG;.\src\res\right.JPG;.\src\res\up.JPG;%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);.\src\res\down.JPG;.\src\res\left.JPG;.\src\res\right.JPG;.\src\res\up.JPG;%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + true + true + + + true + true + + + Document + %(FullPath);.\grey.png;.\blue.png;%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);.\grey.png;.\blue.png;%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + + + true + true + + + true + true + + + true + true + + + true + true + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\example" "-I.\src" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "example\UseKeyBoardDialog.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\example" "-I.\src" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "example\UseKeyBoardDialog.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\example" "-I.\src" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "example\Sheet.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\example" "-I.\src" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "example\Sheet.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\example" "-I.\src" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "example\DynaKeyboard.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\example" "-I.\src" "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "example\DynaKeyboard.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + + + + + + {2B394A83-C563-419A-BECF-A6EE41EB5BE5} + Qt4VSv1.0 + + + + Application + + + Application + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + AllRules.ruleset + + + AllRules.ruleset + + + $(SolutionDir)$(ConfigurationName) + $(SolutionDir)$(ConfigurationName) + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\example;.\src;.\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + qtmaind.lib;QtCored4.lib;QtGuid4.lib;%(AdditionalDependencies) + + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\example;.\src;.\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) + + + MultiThreadedDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + false + qtmain.lib;QtCore4.lib;QtGui4.lib;%(AdditionalDependencies) + + + + + + + + + + + \ No newline at end of file diff --git a/WidgetKeyboard/WidgetKeyboard.vcxproj.filters b/WidgetKeyboard/WidgetKeyboard.vcxproj.filters new file mode 100644 index 0000000..0a66024 --- /dev/null +++ b/WidgetKeyboard/WidgetKeyboard.vcxproj.filters @@ -0,0 +1,138 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;cxx;c;def + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + moc;h;cpp + False + + + {f57afe67-495f-4895-b08f-60d56773d279} + cpp;moc + False + + + {9a02c7f2-76dc-4701-a6df-c48fdbb338e6} + cpp;moc + False + + + + + Source Files + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Generated Files + + + + + Header Files + + + Resource Files + + + Form Files + + + Form Files + + + Header Files + + + Header Files + + + Header Files + + + Resource Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + Generated Files + + + Generated Files + + + \ No newline at end of file diff --git a/WidgetKeyboard/WidgetKeyboard.vcxproj.user b/WidgetKeyboard/WidgetKeyboard.vcxproj.user new file mode 100644 index 0000000..ca1c7bf --- /dev/null +++ b/WidgetKeyboard/WidgetKeyboard.vcxproj.user @@ -0,0 +1,10 @@ + + + + C:\Qt\4.7.3 + PATH=$(QTDIR)\bin%3b$(PATH) + PATH=$(QTDIR)\bin%3b$(PATH) + $(ProjectDir) + WindowsLocalDebugger + + \ No newline at end of file diff --git a/WidgetKeyboard/blue.png b/WidgetKeyboard/blue.png new file mode 100644 index 0000000000000000000000000000000000000000..17abc8121a83563d5c5b43917685b81f9c220562 GIT binary patch literal 4522 zcmV;b5moMqP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=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fz0BUK%E8b#e z=^d#4_EJ*+eoAQ^zYC8ICL{qosha?C*Te4+5?cVR{Jz`#Jh*SMe0<g1Q1zbqG^6FV-5SlcvIRaYxk;8_D%J`SVKA!P4hFUC;aEkRQz0z#s|2q*6jC4 zNe2K`P=J{O(esUA`G*w})BEgKFD(`yS-4hAMTT1$=0G!oLa5g*JZQTVduOHLK)Ns6 zK1HFJ+G{V}zd!mi09Yf6*l^+WZ1Pk$)fbjpKC;o);${o3m8Iq;RuOHF(sx4t2Mv}N ziqVD?Z$A=068)^Ovp_-@Uk494`uh94NYU7mQDDBYbw)6zDx* z4RQEDbpFu(=;_IEIZNm|x3o7v$(J5HWZ%1Y+V@Hy2rKx_nwdNn~~M`gcZ$XBnxOv~0Oun&Q)vueq5uE@07*qo IM6N<$g6?RA!2kdN literal 0 HcmV?d00001 diff --git a/WidgetKeyboard/common.pri b/WidgetKeyboard/common.pri new file mode 100644 index 0000000..453de63 --- /dev/null +++ b/WidgetKeyboard/common.pri @@ -0,0 +1,9 @@ +infile(config.pri, SOLUTIONS_LIBRARY, yes): CONFIG += WidgetKeyboard-uselib +TEMPLATE += fakelib +WIDGETKEYBOARD_LIBNAME = $$qtLibraryTarget(WidgetKeyboard-1.0) +TEMPLATE -= fakelib +WIDGETKEYBOARD_LIBDIR = $$PWD/lib +unix:WidgetKeyboard-uselib:!WidgetKeyboard-buildlib:QMAKE_RPATHDIR += $$WIDGETKEYBOARD_LIBDIR + +RESOURCES += \ + ../ressource.qrc diff --git a/WidgetKeyboard/example/DynaKeyboard.cpp b/WidgetKeyboard/example/DynaKeyboard.cpp new file mode 100644 index 0000000..5dac04d --- /dev/null +++ b/WidgetKeyboard/example/DynaKeyboard.cpp @@ -0,0 +1,73 @@ +#include "DynaKeyboard.h" + +DynaKeyboard::DynaKeyboard() +{ + visual = new DynaKeyboardVisual(0); + haptic = new DynaKeyboardHaptic(this); +} + + +void DynaKeyboard::raiseKeys(QVector keys, bool ctrl, bool shift, bool alt){ + + QVector res = filterRaisedKeys(keys, ctrl, shift, alt); + haptic->raiseKeys(res); + this->keysRaised(res); + + +} + +QVector DynaKeyboard::filterRaisedKeys(QVector keys, bool Ctrl, bool Shift, bool Alt) +{ + QVector res; + return keys; + + if(Ctrl & Shift & Alt) // ctrl shift alt + { + res = ctrlShiftAlt(keys); + }else if (Ctrl & Shift & !Alt) //ctrl shift + { + res = ctrlShift(keys); + }else if (Ctrl & !Shift & Alt) //ctrl alt + { + res = ctrlAlt(keys); + }else if (Ctrl & !Shift & !Alt) + { + res = ctrl(keys); + }else if (!Ctrl &!Shift & Alt) + { + res = alt(keys); + } + + return res; +} + + +QVector DynaKeyboard::ctrl(QVector keys ){ + QVector res; + return res; +} +QVector DynaKeyboard::ctrlShift(QVector keys){ + QVector res; + return res; +} +QVector DynaKeyboard::ctrlShiftAlt(QVector keys){ + QVector res; + return res; +} +QVector DynaKeyboard::ctrlAlt(QVector keys){ + QVector res; + return res; +} + +QVector DynaKeyboard::alt(QVector keys){ + QVector res; + return res; +} + + + +//called from thomas +void DynaKeyboard::keysRaised(QVector keys) +{ + visual->raiseKeys(keys); +} diff --git a/WidgetKeyboard/example/DynaKeyboard.h b/WidgetKeyboard/example/DynaKeyboard.h new file mode 100644 index 0000000..b164de2 --- /dev/null +++ b/WidgetKeyboard/example/DynaKeyboard.h @@ -0,0 +1,33 @@ +#ifndef DYNAKEYBOARD_H +#define DYNAKEYBOARD_H + +#include "DynaKeyboardVisual.h" +#include "DynaKeyboardHaptic.h" + +class DynaKeyboard +{ +public: + DynaKeyboard(); + void init(); + + DynaKeyboardVisual *visual; + DynaKeyboardHaptic *haptic; + + void raiseKeys(QVector keys, bool ctrl, bool shift, bool alt); //called by the application + + //While the application can have several hotkeys + //we just want to raise the most frequent ones, or not rising two neighboor keys + QVector filterRaisedKeys(QVector keys, bool ctrl, bool shift, bool alt); + + void keysRaised(QVector); //called by thomas with the list of keys + +protected: + QVector ctrl(QVector keys ); + QVector ctrlShift(QVector keys); + QVector ctrlShiftAlt(QVector keys); + QVector ctrlAlt(QVector keys); + QVector alt(QVector keys); + +}; + +#endif // DYNAKEYBOARD_H diff --git a/WidgetKeyboard/example/DynaKeyboardHaptic.cpp b/WidgetKeyboard/example/DynaKeyboardHaptic.cpp new file mode 100644 index 0000000..0041d76 --- /dev/null +++ b/WidgetKeyboard/example/DynaKeyboardHaptic.cpp @@ -0,0 +1,21 @@ +#include "DynaKeyboardHaptic.h" +#include "DynaKeyboard.h" + + +DynaKeyboardHaptic::DynaKeyboardHaptic(DynaKeyboard *dyna){ + dynaKeyboard = dyna; +} + +void DynaKeyboardHaptic::raiseKeys(QVector keys) +{ + //you have more keys than solenoids here. +} + +void DynaKeyboardHaptic::initSolenoidKeyMapping() +{ + +} + +void DynaKeyboardHaptic::raiseSolenoids(){} + +void DynaKeyboardHaptic::lowerSolenoids(){} diff --git a/WidgetKeyboard/example/DynaKeyboardHaptic.h b/WidgetKeyboard/example/DynaKeyboardHaptic.h new file mode 100644 index 0000000..803e931 --- /dev/null +++ b/WidgetKeyboard/example/DynaKeyboardHaptic.h @@ -0,0 +1,22 @@ +#ifndef DYNAKEYBOARDHAPTIC_H +#define DYNAKEYBOARDHAPTIC_H + +#include +#include + +class DynaKeyboard; + +class DynaKeyboardHaptic +{ +public: + DynaKeyboardHaptic(DynaKeyboard* dyna); + void initSolenoidKeyMapping(); + void raiseKeys(QVector keys); + void raiseSolenoids(); + void lowerSolenoids(); + + DynaKeyboard *dynaKeyboard; + +}; + +#endif // DYNAKEYBOARDHAPTIC_H diff --git a/WidgetKeyboard/example/DynaKeyboardVisual.cpp b/WidgetKeyboard/example/DynaKeyboardVisual.cpp new file mode 100644 index 0000000..3c20b11 --- /dev/null +++ b/WidgetKeyboard/example/DynaKeyboardVisual.cpp @@ -0,0 +1,101 @@ +#include "DynaKeyboardVisual.h" +#include +#include +//---------------------- +DynaKeyboardVisual::DynaKeyboardVisual(QObject *parent) : + QObject(parent) +{ + debug =0; + // initSolenoidKeyMapping(); + reset(); +} + +//void DynaKeyboardVisual::initSolenoidKeyMapping(){ +// hotkeys.append("C"); +// hotkeys.append("Z"); +// hotkeys.append("B"); +// hotkeys.append("F"); +// hotkeys.append("P"); +// hotkeys.append("N"); +// hotkeys.append("S"); +// hotkeys.append("W"); + + +// for(int i=0;i i(keyState); + while (i.hasNext()) { + i.next(); + //if(solenoid.contains(i.key())) + //{ + keyState.insert(i.key(), b); + } + //std::cout << i.key() << ": " << i.value() << endl; + //} + + //thomas call your method + //for all your solenoid.... + + updateOutput(); +} + +void DynaKeyboardVisual::updateKey(int key, bool raised){ + + //if(solenoid.contains(key)){ + keyState.insert(key, raised); + //int idSolenoid = solenoid.value(key); + //thomas call your method + + updateOutput(); + //} + +} + +void DynaKeyboardVisual::updateOutput() +{ + if(!debug) return; + debug->raiseKeys(keyState); + +} + +void DynaKeyboardVisual::lowerAll(){ + updateAll(0); +} + +void DynaKeyboardVisual::raisAll(){ + updateAll(1); +} + + +void DynaKeyboardVisual::raiseKeys(QVector keys){ + reset(); + for(int i=0; i +#include +#include "WidgetKeyboard.h" +class DynaKeyboardVisual : public QObject +{ + Q_OBJECT +public: + explicit DynaKeyboardVisual(QObject *parent = 0); + void printRaisedKey(); + void setOutput(WidgetKeyboard *_debug){ debug = _debug; } + +signals: + void reportException(QString); + +public slots: + void lowerAll(); + void raisAll(); + void reset(){ lowerAll(); } + void raiseKey(int); + void lowerKey(int); + void raiseKey(QString c); + void lowerKey(QString c); + void raiseKeys(QVector keys); + +protected: + void updateAll(bool); + void updateKey(int, bool raised); + void updateOutput(); + void getSolenoidFromKey(); + void initSolenoidKeyMapping(); + QMap keyState; + // QMap solenoid; + // QVector hotkeys; + WidgetKeyboard *debug; + +}; + +#endif // DynaKeyboardVisual_H diff --git a/WidgetKeyboard/example/Main.cpp b/WidgetKeyboard/example/Main.cpp new file mode 100644 index 0000000..93a9a81 --- /dev/null +++ b/WidgetKeyboard/example/Main.cpp @@ -0,0 +1,43 @@ +/* + * Copyright 2009 EMBITEL (http://www.embitel.com) + * + * This file is part of Virtual Keyboard Project. + * + * Virtual Keyboard 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 + * + * Virtual Keyboard 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 Virtual Keyboard. If not, see . + */ + +#include +#include "UseKeyBoardDialog.h" + +#ifdef Q_WS_MAC +extern void qt_set_sequence_auto_mnemonic(bool b); +#endif + + +#include "Sheet.h" +int main(int argc, char *argv[]) +{ +#ifdef Q_WS_MAC + qt_set_sequence_auto_mnemonic(true); +#endif + + QApplication a(argc, argv); + //UseKeyBoardDialog w; + + Sheet *sheet = new Sheet(); + + + + //w.show(); + return a.exec(); +} diff --git a/WidgetKeyboard/example/MenuBar.cpp b/WidgetKeyboard/example/MenuBar.cpp new file mode 100644 index 0000000..8cdc843 --- /dev/null +++ b/WidgetKeyboard/example/MenuBar.cpp @@ -0,0 +1,10 @@ +#include "MenuBar.h" + +MenuBar::MenuBar() +{ + this->menubar = new QMenuBar() +} + +void buildMenuBar(){ + +} diff --git a/WidgetKeyboard/example/Sheet.cpp b/WidgetKeyboard/example/Sheet.cpp new file mode 100644 index 0000000..59fd406 --- /dev/null +++ b/WidgetKeyboard/example/Sheet.cpp @@ -0,0 +1,301 @@ +#include "Sheet.h" +#include +#include +#include +#include +#include +#include +//extern void qt_set_sequence_auto_mnemonic(true); + +Sheet::Sheet(QWidget *parent) : + QWidget(parent) +{ + window = new QMainWindow(); + + this->resize(800,600); + + window->setCentralWidget(this); + //this->showFullScreen(); + this->createMenuBar(); + window->showFullScreen(); + ctrl = false; + shift = false; + alt = false; + getCtrlHotkeys(); + init(); + this->setFocus(); + QApplication::setStyle(new QPlastiqueStyle); + +} + +void Sheet::init() +{ + dynaKeyboard = new DynaKeyboard(); + WidgetKeyboard *output = new WidgetKeyboard(this); + output->show(); + dynaKeyboard->visual->setOutput(output); + dynaKeyboard->raiseKeys(getCtrlHotkeys(), 0, 0, 0); +} + +void Sheet::createMenuBar() +{ + + menubar = window->menuBar(); + menubar->setNativeMenuBar(false); + QFont font = menubar->font(); + font.setPointSize(16); + menubar->setFont(font); + + QMenu *menu = menubar->addMenu("&File"); + actionMenuList.append(menu->menuAction()); + menu->installEventFilter(this); + menu->setFont(font); + actionList.append( menu->addAction("&New",this, SLOT(newDoc()),QKeySequence(Qt::CTRL + Qt::Key_N))); + actionList.append(menu->addAction("Open",this, SLOT(open()),QKeySequence(Qt::CTRL + Qt::Key_O))); + menu->addSeparator(); + actionList.append(menu->addAction("&Save", this, SLOT(save()), QKeySequence(Qt::CTRL + Qt::Key_S))); + actionList.append(menu->addAction("Save &As", this, SLOT(saveAs()), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_S))); + actionList.append(menu->addAction("Save H&tml", this, SLOT(saveHtml()),QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::ALT + Qt::Key_S))); + menu->addSeparator(); + actionList.append(menu->addAction("Export", this, SLOT(exportDoc()))); + actionList.append(menu->addAction("&Print", this, SLOT(print()), QKeySequence(Qt::CTRL + Qt::Key_P) )); + menu->addSeparator(); + actionList.append(menu->addAction("&Close",this, SLOT(close()),QKeySequence(Qt::CTRL + Qt::Key_W))); + actionList.append(menu->addAction("Close All",this, SLOT(closeAll()),QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W))); + + QMenu *edit = menubar->addMenu("&Edit"); + actionMenuList.append(edit->menuAction()); + edit->setFont(font); + actionList.append(edit->addAction("Undo",this, SLOT(undo()),QKeySequence(Qt::CTRL + Qt::Key_Z))); + actionList.append(edit->addAction("Redo",this, SLOT(redo()),QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z))); + edit->addSeparator(); + actionList.append(edit->addAction("Cu&t", this, SLOT(cut()), QKeySequence(Qt::CTRL + Qt::Key_X))); + actionList.append(edit->addAction("&Copy", this, SLOT(copy()), QKeySequence(Qt::CTRL + Qt::Key_C))); + actionList.append(edit->addAction("&Paste", this, SLOT(paste()), QKeySequence(Qt::CTRL + Qt::Key_V))); + edit->addSeparator(); + actionList.append(edit->addAction("Select All", this, SLOT(selectAll()),QKeySequence(Qt::CTRL + Qt::Key_A))); + edit->addMenu("Advanced"); + edit->addSeparator(); + actionList.append(edit->addAction("Find",this, SLOT(find()),QKeySequence(Qt::CTRL + Qt::Key_F))); + actionList.append(edit->addAction("Find Next",this, SLOT(findNext()),QKeySequence(Qt::CTRL + + Qt::SHIFT + Qt::Key_F))); + + QMenu *tool = menubar->addMenu("&Tool"); + actionMenuList.append(tool->menuAction()); + actionList.append(tool->addAction("&Small Tool",this, SLOT(tool()),QKeySequence(Qt::CTRL + Qt::Key_T))); + actionList.append(tool->addAction("Medium Tool",this, SLOT(tool()),QKeySequence(Qt::CTRL + + Qt::SHIFT + Qt::Key_T))); + actionList.append(tool->addAction("Large Tool",this, SLOT(tool()),QKeySequence(Qt::CTRL + + Qt::SHIFT + Qt::ALT + Qt::Key_T))); + actionList.append(tool->addAction("&Altenrative Tool",this, SLOT(tool()),QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_T))); + actionList.append(tool->addAction("Drawing",this, SLOT(tool()),QKeySequence(Qt::Key_D))); + + QList sequences = actionList.at(actionList.size()-1)->shortcuts(); + for(int i=0;itext()); + } + QMenu *window = menubar->addMenu("&Window"); + actionMenuList.append(window->menuAction()); + QMenu *help = menubar->addMenu("Hel&p"); + actionMenuList.append(help->menuAction()); + +} + +QVector Sheet::getCtrlHotkeys(){ + QVector hotkeys; + bool ctrl2 = false; + bool shift2 =false; + bool alt2 =false; + bool valid = false; + for(int i=0; i< actionList.size();i++) + { + QKeySequence seq = actionList.at(i)->shortcut(); + QString str = seq.toString(); + //qDebug()<< "keysequence: "<< str; + ctrl2 = str.contains("Ctrl"); + shift2 = str.contains("Shift"); + alt2 = str.contains("Alt"); + valid = seq.count(); + if(ctrl2 == ctrl && shift2 == shift && alt2 == alt && valid){ + hotkeys.append(QString(str[str.length()-1])); + + } + + } + + qDebug()<< hotkeys; + return hotkeys; + +} + +QVector Sheet::getAltHotkeys(){ + QVector hotkeys; + if (window->menuBar()->activeAction()) + return hotkeys; + + bool alt2 =false; + for(int i=0; i< actionMenuList.size();i++) + { + QKeySequence seq = actionMenuList.at(i)->shortcut(); + QString str = seq.mnemonic(actionMenuList.at(i)->text()).toString(); + //qDebug()<< "alt keysequence: "<< str; + alt2 = str.contains("Alt"); + + if(alt2 == alt){ + hotkeys.append(QString(str[str.length()-1])); + + } + + } + + return hotkeys; + +} + +QVector Sheet::getImplicitAndAltHotkeys(){ + QVector hotkeys; + + QAction *action = window->menuBar()->activeAction(); + if(!action) + { + hotkeys = getCtrlHotkeys(); + }else{ + QMenu* menu = action->menu(); + for(int i=0; i< actionList.size();i++) + { + if(action->parentWidget() ==menu) + { + QKeySequence seq = actionList.at(i)->shortcut(); + QString str = seq.mnemonic(actionList.at(i)->text()).toString(); + if(str.contains("Alt")) + hotkeys.append(QString(str[str.length()-1])); + } + } + } + + + return hotkeys; +} + + +void Sheet::raiseCtrl(){ + +} +void Sheet::raiseCtrlShift(){} +void Sheet::raiseCtrlShiftAlt(){} +void Sheet::raiseCtrlAlt(){} + +bool Sheet::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + //qDebug()<<"keypressEvent"; + ctrl = ke->modifiers() & Qt::ControlModifier; + shift = ke->modifiers() & Qt::ShiftModifier; + alt = ke->modifiers() & Qt::AltModifier; + if(ctrl) // ctrl shift alt + { + this->dynaKeyboard->raiseKeys(getCtrlHotkeys(), ctrl, shift, alt); + + }else if (!ctrl & !shift & alt) //ctrl shift + { + this->dynaKeyboard->raiseKeys(getAltHotkeys(), ctrl, shift, alt); + }else if( !ctrl & !shift & !alt) + { + this->dynaKeyboard->raiseKeys( getImplicitAndAltHotkeys(), ctrl, shift, alt); + } + + } else if (event->type() == QEvent::KeyRelease) { + QKeyEvent *ke = static_cast(event); + //qDebug()<<"keypressEvent"; + ctrl = ke->modifiers() & Qt::ControlModifier; + shift = ke->modifiers() & Qt::ShiftModifier; + alt = ke->modifiers() & Qt::AltModifier; + if(ctrl) // ctrl shift alt + { + this->dynaKeyboard->raiseKeys(getCtrlHotkeys(), ctrl, shift, alt); + + }else if (!ctrl & !shift & alt) //ctrl shift + { + this->dynaKeyboard->raiseKeys(getAltHotkeys(), ctrl, shift, alt); + }else if( !ctrl & !shift & !alt) + { + this->dynaKeyboard->raiseKeys( getImplicitAndAltHotkeys(), ctrl, shift, alt); + } + } + return false; +} + +bool Sheet::event(QEvent *event) +{ + + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + //qDebug()<<"keypressEvent"; + ctrl = ke->modifiers() & Qt::ControlModifier; + shift = ke->modifiers() & Qt::ShiftModifier; + alt = ke->modifiers() & Qt::AltModifier; + if(ctrl) // ctrl shift alt + { + this->dynaKeyboard->raiseKeys(getCtrlHotkeys(), ctrl, shift, alt); + + }else if (!ctrl & !shift & alt) //ctrl shift + { + this->dynaKeyboard->raiseKeys(getAltHotkeys(), ctrl, shift, alt); + }else if( !ctrl & !shift & !alt) + { + this->dynaKeyboard->raiseKeys( getImplicitAndAltHotkeys(), ctrl, shift, alt); + } + + } else if (event->type() == QEvent::KeyRelease) { + QKeyEvent *ke = static_cast(event); + //qDebug()<<"keypressEvent"; + ctrl = ke->modifiers() & Qt::ControlModifier; + shift = ke->modifiers() & Qt::ShiftModifier; + alt = ke->modifiers() & Qt::AltModifier; + if(ctrl) // ctrl shift alt + { + this->dynaKeyboard->raiseKeys(getCtrlHotkeys(), ctrl, shift, alt); + + }else if (!ctrl & !shift & alt) //ctrl shift + { + this->dynaKeyboard->raiseKeys(getAltHotkeys(), ctrl, shift, alt); + }else if( !ctrl & !shift & !alt) + { + this->dynaKeyboard->raiseKeys( getImplicitAndAltHotkeys(), ctrl, shift, alt); + } + } + + return QWidget::event(event); +} + +void Sheet::keyPressEvent(QKeyEvent *ke) +{ + +} + +void Sheet::keyReleaseEvent(QKeyEvent *ke) +{ + + +} + +void Sheet::newDoc(){ this->setFocus();} +void Sheet::open(){this->setFocus();} +void Sheet::save(){this->setFocus();} +void Sheet::saveAs(){this->setFocus();} +void Sheet::saveHtml(){this->setFocus();} +void Sheet::close(){ this->setFocus(); } +void Sheet::closeAll(){ exit(0); } +void Sheet::exportDoc(){this->setFocus();} +void Sheet::print(){this->setFocus();} +void Sheet::undo(){this->setFocus();} +void Sheet::redo(){this->setFocus();} +void Sheet::cut(){this->setFocus();} +void Sheet::copy(){this->setFocus();} +void Sheet::paste(){this->setFocus();} +void Sheet::selectAll(){this->setFocus();} +void Sheet::find(){this->setFocus();} +void Sheet::findNext(){this->setFocus();} +void Sheet::tool(){this->setFocus();} + + + + diff --git a/WidgetKeyboard/example/Sheet.h b/WidgetKeyboard/example/Sheet.h new file mode 100644 index 0000000..257ae9a --- /dev/null +++ b/WidgetKeyboard/example/Sheet.h @@ -0,0 +1,73 @@ +#ifndef SHEET_H +#define SHEET_H + +#include +#include +#include +#include +#include +#include "DynaKeyboard.h" +#include "WidgetKeyboard.h" +#include +#include +#include +class Sheet : public QWidget +{ + Q_OBJECT +public: + explicit Sheet(QWidget *parent = 0); + void createMenuBar(); + void init(); + + void keyPressEvent(QKeyEvent *); + void keyReleaseEvent(QKeyEvent *); + bool event(QEvent *event); + bool eventFilter(QObject *, QEvent *e); + + void raiseCtrl(); + void raiseCtrlShift(); + void raiseCtrlShiftAlt(); + void raiseCtrlAlt(); + + QVector getCtrlHotkeys(); + QVector getAltHotkeys(); + QVector getImplicitAndAltHotkeys(); + + +public slots: + void newDoc(); + void open(); + void save(); + void saveAs(); + void saveHtml(); + void close(); + void closeAll(); + void exportDoc(); + void print(); + void undo(); + void redo(); + void cut(); + void copy(); + void paste(); + void selectAll(); + void find(); + void findNext(); + void tool(); + + +signals: + +public slots: +public: + QMenuBar* menubar; + QMainWindow *window; + DynaKeyboard *dynaKeyboard; + QVector< QAction *> actionList; + QVector< QAction*> actionMenuList; + + bool ctrl; + bool shift; + bool alt; +}; + +#endif // SHEET_H diff --git a/WidgetKeyboard/example/UseKeyBoardDialog.cpp b/WidgetKeyboard/example/UseKeyBoardDialog.cpp new file mode 100644 index 0000000..06617c0 --- /dev/null +++ b/WidgetKeyboard/example/UseKeyBoardDialog.cpp @@ -0,0 +1,43 @@ +/* + * Copyright 2009 EMBITEL (http://www.embitel.com) + * + * This file is part of Virtual Keyboard Project. + * + * Virtual Keyboard 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 + * + * Virtual Keyboard 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 Virtual Keyboard. If not, see . + * The supplied test sound file is properitery of Windows XP Balloon.wav © 2009 Microsoft Corporation. All rights reserved. + */ + +#include "UseKeyBoardDialog.h" +#include "WidgetKeyboard.h" + +UseKeyBoardDialog::UseKeyBoardDialog(QWidget *parent) : QDialog(parent) +{ + setupUi(this); + virtualKeyBoard = new WidgetKeyboard(this); + virtualKeyBoard->setSoundEnabled("Windows XP Balloon.wav"); +} + +UseKeyBoardDialog::~UseKeyBoardDialog() +{} + +void UseKeyBoardDialog::on_btnShow_clicked() +{ + virtualKeyBoard->show(); + this->lineEdit_2->setFocus(); +} + +void UseKeyBoardDialog::on_btnHide_clicked() +{ + virtualKeyBoard->hide(); + virtualKeyBoard->setSoundDisabled(); +} diff --git a/WidgetKeyboard/example/UseKeyBoardDialog.h b/WidgetKeyboard/example/UseKeyBoardDialog.h new file mode 100644 index 0000000..d2f5917 --- /dev/null +++ b/WidgetKeyboard/example/UseKeyBoardDialog.h @@ -0,0 +1,41 @@ +/* + * Copyright 2009 EMBITEL (http://www.embitel.com) + * + * This file is part of Virtual Keyboard Project. + * + * Virtual Keyboard 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 + * + * Virtual Keyboard 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 Virtual Keyboard. If not, see . + */ + +#ifndef __USEKEYBOARDDIALOG_H_ +#define __USEKEYBOARDDIALOG_H_ + +#include +#include "ui_UseKeyBoardDialog.h" +class WidgetKeyboard; + +class UseKeyBoardDialog : public QDialog , public Ui::UseKeyBoardDialog +{ + Q_OBJECT + + public: + UseKeyBoardDialog(QWidget *parent = 0); + ~UseKeyBoardDialog(); + + private: + WidgetKeyboard *virtualKeyBoard; + + private slots: + void on_btnShow_clicked(); + void on_btnHide_clicked(); +}; +#endif /*__USEKEYBOARDDIALOG_H_*/ diff --git a/WidgetKeyboard/example/UseKeyBoardDialog.ui b/WidgetKeyboard/example/UseKeyBoardDialog.ui new file mode 100644 index 0000000..6bb797a --- /dev/null +++ b/WidgetKeyboard/example/UseKeyBoardDialog.ui @@ -0,0 +1,87 @@ + + + UseKeyBoardDialog + + + + 0 + 0 + 417 + 269 + + + + Using Virtual Keyboard + + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Open VK + + + + + + + Hide VK + + + + + + + + + + + + + diff --git a/WidgetKeyboard/example/example.pro b/WidgetKeyboard/example/example.pro new file mode 100644 index 0000000..818408c --- /dev/null +++ b/WidgetKeyboard/example/example.pro @@ -0,0 +1,21 @@ +TEMPLATE = app +INCLUDEPATH += . + +include(../src/WidgetKeyboard.pri) + +# Input + +TARGET = UseKeyBoardDialog +HEADERS += UseKeyBoardDialog.h \ + DynaKeyboardVisual.h \ + Sheet.h \ + DynaKeyboard.h \ + DynaKeyboardHaptic.h + +FORMS += UseKeyBoardDialog.ui +SOURCES += Main.cpp \ + UseKeyBoardDialog.cpp \ + DynaKeyboardVisual.cpp \ + Sheet.cpp \ + DynaKeyboard.cpp \ + DynaKeyboardHaptic.cpp diff --git a/WidgetKeyboard/grey.png b/WidgetKeyboard/grey.png new file mode 100644 index 0000000000000000000000000000000000000000..b99402dac573fd8319e2b20131f9b9f4656ccfa4 GIT binary patch literal 4153 zcmV-95XSF`P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-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~3;Nh#rZUNSW`^`>px-|Gb=&A0W!@^!1#I_3NRUpi+FVk5Pk zNNU>qzP~s=K7Pt^oO7CHM6~HIAAV~z8qd0}`(YS{Z}ob;sqLQ9?}l32St!#q;kxc^ z&-2b&mh~xs{{~M|*tKid3McfLR;eTQg%B?#N%BILWph%>F{M;R&(*#R;@P4R)!&!r zmsdbNcr=TN=wH(`7c9%VXqx7CQp&p;xZ^k*fc!rIVMRiT@8f_q00000NkvXXu0mjf DkS*g# literal 0 HcmV?d00001 diff --git a/WidgetKeyboard/ressource.qrc b/WidgetKeyboard/ressource.qrc new file mode 100644 index 0000000..920c48c --- /dev/null +++ b/WidgetKeyboard/ressource.qrc @@ -0,0 +1,6 @@ + + + grey.png + blue.png + + diff --git a/WidgetKeyboard/src/WidgetKeyboard.cpp b/WidgetKeyboard/src/WidgetKeyboard.cpp new file mode 100644 index 0000000..93ccdae --- /dev/null +++ b/WidgetKeyboard/src/WidgetKeyboard.cpp @@ -0,0 +1,413 @@ +/* + * Copyright 2009 EMBITEL (http://www.embitel.com) + * + * This file is part of Virtual Keyboard Project. + * + * Virtual Keyboard 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 + * + * Virtual Keyboard 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 Virtual Keyboard. If not, see . + */ + +#include "WidgetKeyboard.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +WidgetKeyboard::WidgetKeyboard(QWidget *parent) : QWidget(0) +{ + setupUi(this); + resize(0,0); + this->setWindowFlags(Qt::Tool); + m_pParent = parent; + isCaps = false; + isShift = false; + isCtrl = false; + isAlt = false; + isIns = false; + changeTextCaps(false); + signalMapper = new QSignalMapper(this); + sliderOpacity->setRange(20,100); + allButtons = findChildren(); + for (int i=0;isetMapping(allButtons.at(i), i); + } + connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(on_btn_clicked(int))); +} + +WidgetKeyboard::~WidgetKeyboard() +{ + delete signalMapper; +} + +void WidgetKeyboard::raiseKeys(const QMap &keyState) +{ + for(int i=0; iaccessibleName(); + bool isOk; + int keyId = strKeyId.toInt(&isOk, 16); + bool find = keyState.contains(keyId); + + bool raised = keyState.value(keyId); + //if(find) qDebug()<<" strKeyId=" << strKeyId << " keyId="<setIcon(icon); + button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + }else{ + //QIcon icon(":grey.png"); + //button->setIcon(icon); + button->setToolButtonStyle(Qt::ToolButtonTextOnly); + } + //button->setVisible(raised); + //button->setDisabled(!raised); + + } + +} + +void WidgetKeyboard::on_btn_clicked(int btn) +{ + if(! soundFilePath.isEmpty()) + QSound::play(soundFilePath); + QString strKeyId; + strKeyId = allButtons.at(btn)->accessibleName(); + bool isOk; + int keyId = strKeyId.toInt(&isOk, 16); + if (strKeyId.isEmpty() || !isOk) { + QMessageBox::information(0,0,"Key Not Found"); + return; + } + + //Keys to be handled separately + if (keyId==Qt::Key_Shift + || keyId==Qt::Key_Control + || keyId==Qt::Key_Alt + || keyId==Qt::Key_Print + ) + return; + + int involvedKeys = 1; + Qt::KeyboardModifiers Modifier = Qt::NoModifier; + if (isCtrl) { + Modifier = Modifier | Qt::ControlModifier; + involvedKeys++; + } + if (isShift) { + Modifier = Modifier | Qt::ShiftModifier; + involvedKeys++; + } + if (isAlt) { + Modifier = Modifier | Qt::AltModifier; + involvedKeys++; + } + + bool isTextKey = false; + + if(keyId==Qt::Key_Insert && !isShift) + return; + + + QString ch = allButtons.at(btn)->text().trimmed(); + if (ch=="&&") + ch="&"; + else if (keyId==Qt::Key_Space) + ch = " "; + else if (checkNotTextKey(keyId)) + ch = QString(); + else + isTextKey = true; + + + if(isIns && isTextKey) { + QKeyEvent keyEventIns(QEvent::KeyPress, Qt::Key_Delete, Qt::NoModifier); + QApplication::sendEvent(m_pParent->focusWidget(), &keyEventIns); + } + + QKeyEvent keyEvent(QEvent::KeyPress, keyId, Modifier, ch, false, involvedKeys); + if(m_pParent) + QApplication::sendEvent(m_pParent->focusWidget(), &keyEvent); + + + btnShiftLeft->setChecked(false); + btnShiftRight->setChecked(false); + btnCtrlLeft->setChecked(false); + btnAltLeft->setChecked(false); +} + +void WidgetKeyboard::on_btnCaps_toggled(bool checked) +{ + changeTextCaps(checked); + isCaps = checked; +} + +void WidgetKeyboard::on_btnShiftLeft_toggled(bool checked) +{ + isShift = checked; + if (isCaps) { + changeTextShift(checked); + } + else { + changeTextShift(checked); + changeTextCaps(checked); + } +} + +void WidgetKeyboard::on_btnShiftRight_toggled(bool checked) +{ + on_btnShiftLeft_toggled(checked); +} + +void WidgetKeyboard::on_btnCtrlLeft_toggled(bool checked) +{ + isCtrl = checked; +} + +void WidgetKeyboard::on_btnAltLeft_toggled(bool checked) +{ + isAlt = checked; +} + +void WidgetKeyboard::on_btnIns_clicked() +{ + isIns = !isIns; +} + +void WidgetKeyboard::on_btnPrint_clicked() +{ + QPixmap screen = QPixmap::grabWindow(QApplication::desktop()->winId()); + QClipboard *cb = QApplication::clipboard(); + cb->setPixmap(screen, QClipboard::Clipboard); +} + +void WidgetKeyboard::on_sliderOpacity_valueChanged(int val) +{ + opacity = 120.0 - val; + opacity /= 100.0; + setWindowOpacity(opacity); +} + +void WidgetKeyboard::changeTextShift(bool isShift) +{ + changeTextCaps(!isShift); + if (isShift) { + btnTilt->setText(QChar('~')); + btn1->setText(QChar('!')); + btn2->setText(QChar('@')); + btn3->setText(QChar('#')); + btn4->setText(QChar('$')); + btn5->setText(QChar('%')); + btn6->setText(QChar('^')); + btn7->setText("&&"); + btn8->setText(QChar('*')); + btn9->setText(QChar('(')); + btn0->setText(QChar(')')); + btnHiphen->setText(QChar('_')); + btnAssign->setText(QChar('+')); + + btnStartSquare->setText(QChar('{')); + btnCloseSquare->setText(QChar('}')); + btnFwdSlash->setText(QChar('|')); + + btnSemiColon->setText(QChar(':')); + btnSp->setText(QChar('"')); + + btnComma->setText(QChar('<')); + btnPeriod->setText(QChar('>')); + btnBcwdSlash->setText(QChar('?')); + } + else { + btnTilt->setText(QChar('`')); + btn1->setText(QChar('1')); + btn2->setText(QChar('2')); + btn3->setText(QChar('3')); + btn4->setText(QChar('4')); + btn5->setText(QChar('5')); + btn6->setText(QChar('6')); + btn7->setText(QChar('7')); + btn8->setText(QChar('8')); + btn9->setText(QChar('9')); + btn0->setText(QChar('0')); + btnHiphen->setText(QChar('-')); + btnAssign->setText(QChar('=')); + + btnStartSquare->setText(QChar('[')); + btnCloseSquare->setText(QChar(']')); + btnFwdSlash->setText(QChar('\\')); + + btnSemiColon->setText(QChar(';')); + btnSp->setText(QChar('\'')); + + btnComma->setText(QChar(',')); + btnPeriod->setText(QChar('.')); + btnBcwdSlash->setText(QChar('/')); + } +} + +void WidgetKeyboard::changeTextCaps(bool isCaps) +{ + if (isCaps) { + btnQ->setText(QChar('Q')); + btnW->setText(QChar('W')); + btnE->setText(QChar('E')); + btnR->setText(QChar('R')); + btnT->setText(QChar('T')); + btnY->setText(QChar('Y')); + btnU->setText(QChar('U')); + btnI->setText(QChar('I')); + btnO->setText(QChar('O')); + btnP->setText(QChar('P')); + + btnA->setText(QChar('A')); + btnS->setText(QChar('S')); + btnD->setText(QChar('D')); + btnF->setText(QChar('F')); + btnG->setText(QChar('G')); + btnH->setText(QChar('H')); + btnJ->setText(QChar('J')); + btnK->setText(QChar('K')); + btnL->setText(QChar('L')); + + btnZ->setText(QChar('Z')); + btnX->setText(QChar('X')); + btnC->setText(QChar('C')); + btnV->setText(QChar('V')); + btnB->setText(QChar('B')); + btnN->setText(QChar('N')); + btnM->setText(QChar('M')); + } + else { + btnQ->setText(QChar('q')); + btnW->setText(QChar('w')); + btnE->setText(QChar('e')); + btnR->setText(QChar('r')); + btnT->setText(QChar('t')); + btnY->setText(QChar('y')); + btnU->setText(QChar('u')); + btnI->setText(QChar('i')); + btnO->setText(QChar('o')); + btnP->setText(QChar('p')); + + btnA->setText(QChar('a')); + btnS->setText(QChar('s')); + btnD->setText(QChar('d')); + btnF->setText(QChar('f')); + btnG->setText(QChar('g')); + btnH->setText(QChar('h')); + btnJ->setText(QChar('j')); + btnK->setText(QChar('k')); + btnL->setText(QChar('l')); + + btnZ->setText(QChar('z')); + btnX->setText(QChar('x')); + btnC->setText(QChar('c')); + btnV->setText(QChar('v')); + btnB->setText(QChar('b')); + btnN->setText(QChar('n')); + btnM->setText(QChar('m')); + } +} + +bool WidgetKeyboard::checkNotTextKey(int keyId) +{ + if (keyId==Qt::Key_Shift + || keyId==Qt::Key_Control + || keyId==Qt::Key_Tab + || keyId==Qt::Key_Escape + || keyId==Qt::Key_Return + || keyId==Qt::Key_Insert + || keyId==Qt::Key_NumLock + || keyId==Qt::Key_F1 + || keyId==Qt::Key_F2 + || keyId==Qt::Key_F3 + || keyId==Qt::Key_F4 + || keyId==Qt::Key_F5 + || keyId==Qt::Key_F6 + || keyId==Qt::Key_F7 + || keyId==Qt::Key_F8 + || keyId==Qt::Key_F9 + || keyId==Qt::Key_F10 + || keyId==Qt::Key_F11 + || keyId==Qt::Key_F12 + || keyId==Qt::Key_Print + || keyId==Qt::Key_Pause + || keyId==Qt::Key_ScrollLock + || keyId==Qt::Key_Enter + || keyId==Qt::Key_Home + || keyId==Qt::Key_End + || keyId==Qt::Key_CapsLock + || keyId==Qt::Key_Insert + || keyId==Qt::Key_Delete + || keyId==Qt::Key_PageUp + || keyId==Qt::Key_PageDown + || keyId==Qt::Key_Down + || keyId==Qt::Key_Up + || keyId==Qt::Key_Left + || keyId==Qt::Key_Right + || keyId==Qt::Key_Alt) { + return true; + } + else + return false; +} + +void WidgetKeyboard::setOpacity(int opacity) +{ + sliderOpacity->setValue(opacity); +} + +int WidgetKeyboard::getOpacity() +{ + return sliderOpacity->value(); +} + +void WidgetKeyboard::setSoundDisabled() +{ + soundFilePath = ""; +} + +/* +Microsoft Windows : The underlying multimedia system is used; only WAVE format sound files are supported. +X11 : The Network Audio System is used if available, otherwise all operations work silently. NAS supports WAVE and AU files. +Mac OS X : NSSound is used. All formats that NSSound supports, including QuickTime formats, are supported by Qt for Mac OS X. +Qt for Embedded Linux : A built-in mixing sound server is used, accessing /dev/dsp directly. Only the WAVE format is supported. +*/ + +void WidgetKeyboard::setSoundEnabled(QString soundPath) +{ + soundFilePath = soundPath; +} + +void WidgetKeyboard::on_checkBoxShowNumPad_stateChanged(int state) +{ + QList children = frameNumPad->findChildren(); + if(state==Qt::Checked) + { + frameNumPad->show(); + /*for each(QWidget *child in children) + child->show();*/ + } + else + { + frameNumPad->hide(); + /*for each(QWidget *child in children) + child->hide();*/ + } + update(); +} diff --git a/WidgetKeyboard/src/WidgetKeyboard.h b/WidgetKeyboard/src/WidgetKeyboard.h new file mode 100644 index 0000000..02c3611 --- /dev/null +++ b/WidgetKeyboard/src/WidgetKeyboard.h @@ -0,0 +1,69 @@ +/* + * Copyright 2009 EMBITEL (http://www.embitel.com) + * + * This file is part of Virtual Keyboard Project. + * + * Virtual Keyboard 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 + * + * Virtual Keyboard 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 Virtual Keyboard. If not, see . + */ + +#ifndef __WIDGETKEYBOARD_H_ +#define __WIDGETKEYBOARD_H_ + +#include +#include "ui_WidgetKeyboard.h" +class QSignalMapper; + +class WidgetKeyboard : public QWidget, public Ui::WidgetKeyboard +{ + Q_OBJECT + + private: + QWidget *m_pParent; + qreal opacity; + bool isCaps; + bool isShift; + bool isCtrl; + bool isAlt; + bool isIns; + QSignalMapper *signalMapper; + QList allButtons; + QString soundFilePath; + + private slots: + void on_btn_clicked(int btn); + void on_btnCaps_toggled(bool checked); + void on_btnShiftLeft_toggled(bool checked); + void on_btnShiftRight_toggled(bool checked); + void on_btnCtrlLeft_toggled(bool checked); + void on_btnAltLeft_toggled(bool checked); + void on_btnIns_clicked(); + void on_btnPrint_clicked(); + void on_sliderOpacity_valueChanged(int); + void changeTextShift(bool isShift); + void changeTextCaps(bool isCaps); + bool checkNotTextKey(int keyId); + void on_checkBoxShowNumPad_stateChanged(int state); + + public slots: + void raiseKeys(const QMap &keyState); + + + public: + WidgetKeyboard(QWidget *parent = NULL); + ~WidgetKeyboard(); + void setOpacity(int); + int getOpacity(); + void setSoundDisabled(); + void setSoundEnabled(QString soundPath); +}; +#endif /*__WIDGETKEYBOARD_H_*/ diff --git a/WidgetKeyboard/src/WidgetKeyboard.pri b/WidgetKeyboard/src/WidgetKeyboard.pri new file mode 100644 index 0000000..de6cb19 --- /dev/null +++ b/WidgetKeyboard/src/WidgetKeyboard.pri @@ -0,0 +1,18 @@ +include(../common.pri) +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD + +WidgetKeyboard-uselib:!WidgetKeyboard-buildlib { + LIBS += -L$$WIDGETKEYBOARD_LIBDIR -l$$WIDGETKEYBOARD_LIBNAME +} else { + SOURCES += $$PWD/WidgetKeyboard.cpp + HEADERS += $$PWD/WidgetKeyboard.h + FORMS += $$PWD/WidgetKeyboard.ui + RESOURCES += $$PWD/WidgetKeyboard.qrc +} + +win32 { + contains(TEMPLATE, lib):contains(CONFIG, shared):DEFINES += WIDGETKEYBOARD_EXPORT + else:WidgetKeyboard-uselib:DEFINES += WIDGETKEYBOARD_IMPORT +} + diff --git a/WidgetKeyboard/src/WidgetKeyboard.qrc b/WidgetKeyboard/src/WidgetKeyboard.qrc new file mode 100644 index 0000000..0e66fd3 --- /dev/null +++ b/WidgetKeyboard/src/WidgetKeyboard.qrc @@ -0,0 +1,8 @@ + + + res/down.JPG + res/left.JPG + res/right.JPG + res/up.JPG + + diff --git a/WidgetKeyboard/src/WidgetKeyboard.ui b/WidgetKeyboard/src/WidgetKeyboard.ui new file mode 100644 index 0000000..c9311dd --- /dev/null +++ b/WidgetKeyboard/src/WidgetKeyboard.ui @@ -0,0 +1,2654 @@ + + + WidgetKeyboard + + + + 0 + 0 + 780 + 197 + + + + Virtual Keyboard + + + + 2 + + + 2 + + + + + + + 2 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000000 + + + + + + Esc + + + true + + + + + + + Qt::Horizontal + + + + 50 + 22 + + + + + + + + 2 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000030 + + + F1 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000031 + + + F2 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000032 + + + F3 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000033 + + + F4 + + + true + + + + + + + + + Qt::Horizontal + + + + 50 + 16 + + + + + + + + 2 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000034 + + + F5 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000035 + + + F6 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000036 + + + F7 + + + true + + + + + + + + 0 + 0 + + + + + 8 + + + + 0x01000037 + + + F8 + + + true + + + + + + + + + Qt::Horizontal + + + + 50 + 17 + + + + + + + + 2 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000038 + + + F9 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000039 + + + F10 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x0100003a + + + F11 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x0100003b + + + F12 + + + true + + + + + + + + + + + 3 + + + + + true + + + + 0 + 0 + + + + + 12 + + + + 0x01000009 + + + Print +Screen + + + true + + + + + + + false + + + + 0 + 0 + + + + + 12 + + + + 0x01000026 + + + Scroll +Lock + + + true + + + + + + + false + + + + 0 + 0 + + + + + 12 + + + + 0x01000008 + + + Pause +Break + + + true + + + + + + + + + + + 3 + + + 0 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000006 + + + Insert + + + false + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000010 + + + Home + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000016 + + + PgUP + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000007 + + + Delete + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000011 + + + End + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000017 + + + PgDn + + + true + + + + + + + + + Show Numeric Keypad + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + + 8 + + + + 0x01000013 + + + + + + + :/myresources/upIcon:/myresources/upIcon + + + true + + + + + + + + 0 + 0 + + + + + 8 + + + + 0x01000012 + + + + + + + :/myresources/leftIcon:/myresources/leftIcon + + + true + + + + + + + + 0 + 0 + + + + + 8 + + + + 0x01000015 + + + + + + + :/myresources/downIcon:/myresources/downIcon + + + true + + + + + + + + 0 + 0 + + + + + 8 + + + + 0x01000014 + + + + + + + :/myresources/rightIcon:/myresources/rightIcon + + + true + + + + + + + + + + + 3 + + + + + 0 + + + + + + 0 + 0 + + + + + 12 + + + + 0x60 + + + ` + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x31 + + + 1 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x32 + + + 2 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x33 + + + 3 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x34 + + + 4 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x35 + + + 5 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x36 + + + 6 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x37 + + + 7 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x38 + + + 8 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x39 + + + 9 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x30 + + + 0 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x2d + + + - + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 13 + + + = + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000003 + + + Backspace + + + true + + + + + + + + + 0 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000024 + + + Caps + + + true + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x41 + + + A + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x53 + + + S + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x44 + + + D + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x46 + + + F + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x47 + + + G + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x48 + + + H + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x4a + + + J + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x4b + + + K + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x4c + + + L + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x3b + + + ; + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x27 + + + ' + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000004 + + + Return + + + true + + + + + + + + + 0 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000020 + + + Shift + + + true + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x5a + + + Z + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x58 + + + X + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x43 + + + C + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x56 + + + V + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x42 + + + B + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x4e + + + N + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x4d + + + M + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x2c + + + , + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x2e + + + . + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x2f + + + / + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000020 + + + Shift + + + true + + + true + + + + + + + + + 0 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000021 + + + Ctrl + + + true + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000023 + + + Alt + + + true + + + true + + + + + + + + 0 + 0 + + + + + 8 + + + + 0x20 + + + + + + true + + + + + + + + 0 + 0 + + + + Transparency + + + Qt::Horizontal + + + + + + + + + 0 + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000001 + + + Tab + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x51 + + + Q + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x57 + + + W + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x45 + + + E + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x52 + + + R + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x54 + + + T + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x59 + + + Y + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x55 + + + U + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x49 + + + I + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x4f + + + O + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x50 + + + P + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x5b + + + [ + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x5d + + + ] + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x5c + + + \ + + + true + + + + + + + + + + + QFrame::NoFrame + + + 1 + + + + 3 + + + 0 + + + + + + 0 + 0 + + + + + 12 + + + + 0x2f + + + / + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x2a + + + * + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x2d + + + - + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x37 + + + 7 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x38 + + + 8 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x39 + + + 9 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x34 + + + 4 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x35 + + + 5 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x36 + + + 6 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x2b + + + + + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x31 + + + 1 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x32 + + + 2 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x33 + + + 3 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x30 + + + 0 + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x2e + + + . + + + true + + + + + + + + 0 + 0 + + + + + 12 + + + + 0x01000005 + + + Enter + + + true + + + + + + + false + + + + 0 + 0 + + + + + 12 + + + + 0x01000025 + + + Num +Lock + + + true + + + + + + + + + + + + + + + + diff --git a/WidgetKeyboard/src/res/down.JPG b/WidgetKeyboard/src/res/down.JPG new file mode 100644 index 0000000000000000000000000000000000000000..33812e747741353aacf6866a0446c0f526f4ccd3 GIT binary patch literal 937 zcmex=Hq-)3-T;9z58XJh4H zXJ_Z+|EI`$@KzRlhK~^C}Lq|5@z(jVX zLJ_0Ji3>TDoi-j64Z8S2#W<;`iIYoATtZSxRZU$(Q_IBE%-q7#%Gt%$&E3P(D>x)H zEIcAIDmf)JEj=SMtGJ}Jth}PKs=1}Lt-YhOYtrN?Q>RUzF>}_U#Y>hhTfSoDs!f}> zY~8kf$Ie}c4j(ys?D&b3r!HN-a`oEv8#iw~eDwIq(`V0LynOZX)8{W=zkUDl^B2fp zj10^WZ^3Gpe_ee&|N2V#j`vQ?M@*jmJ9i~l z??~dm^IE3_KJLzBsn`0pp8LnQdf`{|Q`%iB7P;t~{Ab9xqb%{bcd^PG{xjd!t8Tme ze9z9lTldT=QwzG9dp7=ySYP_#c>976_xfd*Bu16}Tt0<=-+zXOw^lZ8brlI|2y_); poSgaatkvn*T~{A<|5bZX{-Wi1VZ6`BU%zHuThzs%0mT1r0sztbXgUA@ literal 0 HcmV?d00001 diff --git a/WidgetKeyboard/src/res/left.JPG b/WidgetKeyboard/src/res/left.JPG new file mode 100644 index 0000000000000000000000000000000000000000..261591ef005786266f52b483845372b0f66f9e3c GIT binary patch literal 929 zcmex=Hq-)3-T;9z58XJh4H zXJ_Z+|EI`$@KzRlhK~^C}Lq|5@z(jVX zLJ_0Ji3>TDoi-j64Z8S2#W<;`iIYoATtZSxRZU$(Q_IBE%-q7#%Gt%$&E3P(D>x)H zEIcAIDmf)JEj=SMtGJ}Jth}PKs=1}Lt-YhOYtrN?Q>RUzF>}_U#Y>hhTfSoDs!f}> zY~8kf$Ie}c4j(ys?D&b3r!HN-a`oEv8#iw~eDwIq(`V0LynOZX)8{W=zkUDl^B2fp zj10^WZ^3ZF@(F>+f6V=Gblb{AUuuYo)o-TlR>ziJwZBmG#2ocAFHa{ydqQ8 zWc8#4%+I5jpZcs{z*l*Ex%{O)Rxjlwqbvm{UYMGaddpF^ ztY5N+apAom^)5R$?Q@B=yY{Z9hoj`y0)yjzb2->{?J8%U`Xf8ncK+eDLie6YD$KLs a+LE_4lJD`2i?N}i3L=573@}{(|0VzsGFnXl literal 0 HcmV?d00001 diff --git a/WidgetKeyboard/src/res/right.JPG b/WidgetKeyboard/src/res/right.JPG new file mode 100644 index 0000000000000000000000000000000000000000..92e12141b5f94743bc439df94b869a39ccf75f29 GIT binary patch literal 934 zcmex=Hq-)3-T;9z58XJh4H zXJ_Z+|EI`$@KzRlhK~^C}Lq|5@z(jVX zLJ_0Ji3>TDoi-j64Z8S2#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