diff --git a/src/lib/AutoType.cpp b/src/lib/AutoType.cpp index f526e27..95d56f7 100644 --- a/src/lib/AutoType.cpp +++ b/src/lib/AutoType.cpp @@ -21,37 +21,72 @@ #include "AutoType.h" #include #include -#ifdef Q_WS_X11 - #include - #include -#endif - +/* { 0x05c7, 0x0627 }, Arabic_alef ا ARABIC LETTER ALEF */ QWidget* AutoType::MainWin=NULL; -void AutoType::perform(const QString& string){ -QList Chars; -QString str("Fragezeichen ? Umlaute öäü Euro €"); -for(int i=0;i Keys; +for(int i=0;ihide(); - Display* pDisplay = XOpenDisplay( NULL ); -for(int i=0;ishow(); - } + + + tKeysymMap AutoType::KeysymMap[] = { { 0x01a1, 0x0104 }, /* Aogonek Ą LATIN CAPITAL LETTER A WITH OGONEK */ @@ -829,10 +864,9 @@ tKeysymMap AutoType::KeysymMap[] = { 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */ }; -unsigned long AutoType::getKeysym(const QChar& c){ +Q_UINT16 AutoType::getKeysym(const QChar& c){ int MapSize=sizeof(KeysymMap); Q_UINT16 unicode=c.unicode(); - /* first check for Latin-1 characters (1:1 mapping) */ if ((unicode >= 0x0020 && unicode <= 0x007e) || (unicode >= 0x00a0 && unicode <= 0x00ff)) diff --git a/src/lib/AutoType.h b/src/lib/AutoType.h index b932256..c4ec96c 100644 --- a/src/lib/AutoType.h +++ b/src/lib/AutoType.h @@ -23,6 +23,13 @@ #include #include +#ifdef Q_WS_X11 + #define XK_MISCELLANY + #define XK_XKB_KEYS + #include + #include + #include +#endif typedef struct tKeysymMap{ Q_UINT16 keysym; @@ -35,7 +42,10 @@ public: static void perform(const QString& KeePassAutoTypeString); private: static tKeysymMap KeysymMap[]; - static unsigned long getKeysym(const QChar& unicode); + static Q_UINT16 getKeysym(const QChar& unicode); + static int getModifiers(Display*,KeySym,int); + static void pressModifiers(Display*,int,bool Press=true); + static void releaseModifiers(Display*,int); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8ad17ac..9a0104c 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -324,8 +324,6 @@ return true; void KeepassMainWindow::OnFileNew(){ -AutoType::perform(""); -return; if(FileOpen) if(!closeDatabase())return; CPasswordDialog dlg(this,"PasswordDlg",true,false,true);