Use xvkbd code for sending auto-type keys Fixed bug that prevented auto-typing non-latin1 chars Added Italian translation Fixed some new gcc warnings git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@238 b624d157-de02-0410-bad0-e51aec6abb33master
parent
bb80c9616a
commit
888d0982d4
@ -0,0 +1,267 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005-2008 by Tarek Saidi, Felix Geyer * |
||||
* tarek.saidi@arcor.de * |
||||
* * |
||||
* This program 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; version 2 of the License. * |
||||
|
||||
* * |
||||
* This program 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 this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "AutoTypeGlobalX11.h" |
||||
|
||||
#include "mainwindow.h" |
||||
#include "lib/HelperX11.h" |
||||
#include "dialogs/AutoTypeDlg.h" |
||||
#include <QX11Info> |
||||
|
||||
AutoTypeGlobal* autoType = NULL; |
||||
|
||||
void initAutoType(KeepassMainWindow* mainWin) { |
||||
autoType = new AutoTypeGlobalX11(mainWin); |
||||
} |
||||
|
||||
AutoTypeGlobalX11::AutoTypeGlobalX11(KeepassMainWindow* mainWin) : AutoTypeX11(mainWin) { |
||||
wm_state = XInternAtom(dpy, "WM_STATE", true); |
||||
windowRoot = XRootWindow(dpy, mainWin->x11Info().screen()); |
||||
focusedWindow = NULL; |
||||
//windowBlacklist << "kicker" << "KDE Desktop";
|
||||
classBlacklist << "desktop_window" << "gnome-panel"; // Gnome
|
||||
classBlacklist << "kdesktop" << "kicker"; // KDE 3
|
||||
classBlacklist << "xfdesktop" << "xfce4-panel"; // Xfce 4
|
||||
} |
||||
|
||||
void AutoTypeGlobalX11::perform(IEntryHandle* entry, bool hideWindow, int nr, bool wasLocked){ |
||||
if (focusedWindow && (!hideWindow || wasLocked)) { // detect if global auto-type
|
||||
XSetInputFocus(dpy, focusedWindow, RevertToPointerRoot, CurrentTime); |
||||
focusedWindow = NULL; |
||||
} |
||||
AutoTypeX11::perform(entry, hideWindow, nr, wasLocked); |
||||
} |
||||
|
||||
void AutoTypeGlobalX11::windowTitles(Window window, QStringList& titleList){ |
||||
Atom type = None; |
||||
int format; |
||||
unsigned long nitems, after; |
||||
unsigned char* data; |
||||
XGetWindowProperty(dpy, window, wm_state, 0, 0, false, AnyPropertyType, &type, &format, &nitems, &after, &data); |
||||
if (type){ |
||||
XTextProperty textProp; |
||||
if (XGetWMName(dpy, window, &textProp) != 0) { |
||||
char** list = NULL; |
||||
int count; |
||||
if (Xutf8TextPropertyToTextList(dpy, &textProp, &list, &count)>=0 && list){ |
||||
QString title = QString::fromUtf8(list[0]); |
||||
|
||||
QString className; |
||||
XClassHint* wmClass = XAllocClassHint(); |
||||
if (XGetClassHint(dpy, window, wmClass)!=0 && wmClass->res_name!=NULL) |
||||
className = QString::fromLocal8Bit(wmClass->res_name); |
||||
XFree(wmClass); |
||||
|
||||
if (window!=windowRoot && window!=mainWin->winId() && |
||||
(QApplication::activeWindow()==NULL || window!=QApplication::activeWindow()->winId()) && |
||||
// !windowBlacklist.contains(title) &&
|
||||
(className.isNull() || !classBlacklist.contains(className)) |
||||
){ |
||||
titleList.append(title); |
||||
} |
||||
XFreeStringList(list); |
||||
} |
||||
} |
||||
} |
||||
|
||||
Window root; |
||||
Window parent; |
||||
Window* children = NULL; |
||||
unsigned int num_children; |
||||
int tree = XQueryTree(dpy, window, &root, &parent, &children, &num_children); |
||||
if (tree && children){ |
||||
for (int i=0; i<num_children; i++) |
||||
windowTitles(children[i], titleList); |
||||
} |
||||
else |
||||
XFree(children); |
||||
} |
||||
|
||||
QStringList AutoTypeGlobalX11::getAllWindowTitles(){ |
||||
QStringList titleList; |
||||
if (wm_state) // don't do anything if WM_STATE doesn't exist
|
||||
windowTitles(windowRoot, titleList); |
||||
return titleList; |
||||
} |
||||
|
||||
void AutoTypeGlobalX11::performGlobal(){ |
||||
bool wasLocked = mainWin->isLocked(); |
||||
if (wasLocked) |
||||
mainWin->OnUnLockWorkspace(); |
||||
|
||||
if (!mainWin->isOpened()) |
||||
return; |
||||
|
||||
Window w; |
||||
int revert_to_return; |
||||
XGetInputFocus(dpy, &w, &revert_to_return); |
||||
char** list = NULL; |
||||
int tree; |
||||
do { |
||||
XTextProperty textProp; |
||||
if (XGetWMName(dpy, w, &textProp) != 0) { |
||||
int count; |
||||
if (Xutf8TextPropertyToTextList(dpy, &textProp, &list, &count)<0) return; |
||||
if (list) break; |
||||
} |
||||
Window root = 0; |
||||
Window parent = 0; |
||||
Window* children = NULL; |
||||
unsigned int num_children; |
||||
tree = XQueryTree(dpy, w, &root, &parent, &children, &num_children); |
||||
w = parent; |
||||
if (children) XFree(children); |
||||
} while (tree && w); |
||||
if (!list) return; |
||||
QString title = QString::fromUtf8(list[0]).toLower(); |
||||
XFreeStringList(list); |
||||
|
||||
QList<IEntryHandle*> validEntries; |
||||
QList<int> entryNumbers; |
||||
QList<IEntryHandle*> entries = mainWin->db->entries(); |
||||
QRegExp lineMatch("Auto-Type-Window(?:-(\\d+)|):([^\\n]+)", Qt::CaseInsensitive, QRegExp::RegExp2); |
||||
QDateTime now = QDateTime::currentDateTime(); |
||||
for (int i=0; i<entries.size(); i++){ |
||||
if ( (entries[i]->expire()!=Date_Never && entries[i]->expire()<now) || |
||||
(getRootGroupName(entries[i]).compare("backup",Qt::CaseInsensitive)==0) |
||||
){ |
||||
continue; |
||||
} |
||||
|
||||
bool hasWindowEntry=false; |
||||
QString comment = entries[i]->comment(); |
||||
int offset = 0; |
||||
while ( (offset=lineMatch.indexIn(comment, offset))!=-1 ){ |
||||
QStringList captured = lineMatch.capturedTexts(); |
||||
offset += captured[0].length(); |
||||
int nr; |
||||
QString entryWindow; |
||||
bool valid; |
||||
if (captured.size()==2){ |
||||
nr = 0; |
||||
entryWindow = captured[1].trimmed().toLower(); |
||||
} |
||||
else{ |
||||
nr = captured[1].toInt(); |
||||
entryWindow = captured[2].trimmed().toLower(); |
||||
} |
||||
if (entryWindow.length()==0) continue; |
||||
|
||||
hasWindowEntry = true; |
||||
bool wildStart = (entryWindow[0]=='*'); |
||||
bool wildEnd = (entryWindow[entryWindow.size()-1]=='*'); |
||||
if (wildStart&&wildEnd){ |
||||
entryWindow.remove(0,1); |
||||
if (entryWindow.length()!=0){ |
||||
entryWindow.remove(entryWindow.size()-1,1); |
||||
valid = title.contains(entryWindow); |
||||
} |
||||
else |
||||
valid = true; |
||||
} |
||||
else if (wildStart){ |
||||
entryWindow.remove(0,1); |
||||
valid = title.endsWith(entryWindow); |
||||
} |
||||
else if (wildEnd){ |
||||
entryWindow.remove(entryWindow.size()-1,1); |
||||
valid = title.startsWith(entryWindow); |
||||
} |
||||
else { |
||||
valid = (title==entryWindow); |
||||
} |
||||
|
||||
if (valid){ |
||||
validEntries << entries[i]; |
||||
entryNumbers << nr; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
if (!hasWindowEntry && config->entryTitlesMatch()){ |
||||
QString entryTitle = entries[i]->title().toLower(); |
||||
if (!entryTitle.isEmpty() && title.contains(entryTitle)){ |
||||
validEntries << entries[i]; |
||||
entryNumbers << 0; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (validEntries.size()==1){ |
||||
focusedWindow = NULL; |
||||
perform(validEntries[0],wasLocked,entryNumbers[0],wasLocked); |
||||
} |
||||
else if (validEntries.size()>1){ |
||||
focusedWindow = w; |
||||
AutoTypeDlg* dlg = new AutoTypeDlg(validEntries, entryNumbers, wasLocked); |
||||
dlg->show(); |
||||
} |
||||
} |
||||
|
||||
bool AutoTypeGlobalX11::registerGlobalShortcut(const Shortcut& s){ |
||||
if (s.key==shortcut.key && s.ctrl==shortcut.ctrl && s.shift==shortcut.shift && s.alt==shortcut.alt && s.altgr==shortcut.altgr && s.win==shortcut.win) |
||||
return true; |
||||
|
||||
int code=XKeysymToKeycode(dpy, HelperX11::getKeysym(s.key)); |
||||
int mod=HelperX11::getShortcutModifierMask(s); |
||||
|
||||
HelperX11::startCatchErrors(); |
||||
XGrabKey(dpy, code, mod, windowRoot, true, GrabModeAsync, GrabModeAsync); |
||||
XGrabKey(dpy, code, mod | Mod2Mask, windowRoot, true, GrabModeAsync, GrabModeAsync); |
||||
XGrabKey(dpy, code, mod | LockMask, windowRoot, true, GrabModeAsync, GrabModeAsync); |
||||
XGrabKey(dpy, code, mod | Mod2Mask | LockMask, windowRoot, true, GrabModeAsync, GrabModeAsync); |
||||
HelperX11::stopCatchErrors(); |
||||
|
||||
if (HelperX11::errorOccurred()){ |
||||
XUngrabKey(dpy, code, mod, windowRoot); |
||||
XUngrabKey(dpy, code, mod | Mod2Mask, windowRoot); |
||||
XUngrabKey(dpy, code, mod | LockMask, windowRoot); |
||||
XUngrabKey(dpy, code, mod | Mod2Mask | LockMask, windowRoot); |
||||
return false; |
||||
} |
||||
else { |
||||
unregisterGlobalShortcut(); |
||||
shortcut = s; |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
void AutoTypeGlobalX11::unregisterGlobalShortcut(){ |
||||
if (shortcut.key==0) return; |
||||
|
||||
int code=XKeysymToKeycode(dpy, HelperX11::getKeysym(shortcut.key)); |
||||
int mod=HelperX11::getShortcutModifierMask(shortcut); |
||||
|
||||
XUngrabKey(dpy, code, mod, windowRoot); |
||||
XUngrabKey(dpy, code, mod | Mod2Mask, windowRoot); |
||||
XUngrabKey(dpy, code, mod | LockMask, windowRoot); |
||||
XUngrabKey(dpy, code, mod | Mod2Mask | LockMask, windowRoot); |
||||
|
||||
shortcut.key = 0; |
||||
} |
||||
|
||||
QString AutoTypeGlobalX11::getRootGroupName(IEntryHandle* entry){ |
||||
IGroupHandle* group = entry->group(); |
||||
int level = group->level(); |
||||
for (int i=0; i<level; i++) |
||||
group = group->parent(); |
||||
|
||||
return group->title(); |
||||
} |
@ -0,0 +1,46 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005-2008 by Tarek Saidi, Felix Geyer * |
||||
* tarek.saidi@arcor.de * |
||||
* * |
||||
* This program 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; version 2 of the License. * |
||||
|
||||
* * |
||||
* This program 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 this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#ifndef _AUTOTYPEGLOBALX11_H_ |
||||
#define _AUTOTYPEGLOBALX11_H_ |
||||
|
||||
#include "AutoTypeX11.h" |
||||
|
||||
class AutoTypeGlobalX11 : public AutoTypeX11, public AutoTypeGlobal { |
||||
public: |
||||
AutoTypeGlobalX11(KeepassMainWindow* mainWin); |
||||
void perform(IEntryHandle* entry, bool hideWindow=true, int nr=0, bool wasLocked=false); |
||||
void performGlobal(); |
||||
bool registerGlobalShortcut(const Shortcut& s); |
||||
void unregisterGlobalShortcut(); |
||||
QStringList getAllWindowTitles(); |
||||
|
||||
private: |
||||
void windowTitles(Window window, QStringList& titleList); |
||||
QString getRootGroupName(IEntryHandle* entry); |
||||
|
||||
Window windowRoot; |
||||
//QSet<QString> windowBlacklist;
|
||||
QSet<QString> classBlacklist; |
||||
Atom wm_state; |
||||
Window focusedWindow; |
||||
}; |
||||
|
||||
#endif // _AUTOTYPEGLOBALX11_H_
|
@ -0,0 +1,866 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2005-2008 by Tarek Saidi, Felix Geyer * |
||||
* tarek.saidi@arcor.de * |
||||
* * |
||||
* This program 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; version 2 of the License. * |
||||
|
||||
* * |
||||
* This program 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 this program; if not, write to the * |
||||
* Free Software Foundation, Inc., * |
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||||
***************************************************************************/ |
||||
|
||||
#include "AutoTypeX11.h" |
||||
|
||||
#include "mainwindow.h" |
||||
#include "lib/HelperX11.h" |
||||
#include <QX11Info> |
||||
|
||||
#ifndef GLOBAL_AUTOTYPE |
||||
AutoType* autoType = NULL; |
||||
|
||||
void initAutoType(KeepassMainWindow* mainWin) { |
||||
autoType = new AutoTypeX11(mainWin); |
||||
} |
||||
#endif |
||||
|
||||
AutoTypeAction::AutoTypeAction(AutoTypeActionType t, quint16 d) : type(t), data(d){ |
||||
} |
||||
|
||||
bool AutoTypeX11::error_detected = false; |
||||
|
||||
AutoTypeX11::AutoTypeX11(KeepassMainWindow* mainWin) { |
||||
this->mainWin = mainWin; |
||||
dpy = mainWin->x11Info().display(); |
||||
|
||||
keysym_table = NULL; |
||||
alt_mask = 0; |
||||
meta_mask = 0; |
||||
altgr_mask = 0; |
||||
altgr_keysym = NoSymbol; |
||||
focused_window = None; |
||||
focused_subwindow = None; |
||||
|
||||
ReadKeymap(); |
||||
if (!altgr_mask) |
||||
AddModifier(XK_Mode_switch); |
||||
} |
||||
|
||||
void AutoTypeX11::perform(IEntryHandle* entry, bool hideWindow, int nr, bool wasLocked){ |
||||
QString indexStr; |
||||
if (nr==0) |
||||
indexStr = "Auto-Type:"; |
||||
else |
||||
indexStr = QString("Auto-Type-%1:").arg(nr); |
||||
QString str; |
||||
QString comment=entry->comment(); |
||||
int c=comment.count(indexStr, Qt::CaseInsensitive); |
||||
if(c>1) { |
||||
qWarning("More than one 'Auto-Type:' key sequence found.\nAllowed is only one per entry."); |
||||
return; |
||||
} |
||||
else if (c==1) { |
||||
int start = comment.indexOf(indexStr,0,Qt::CaseInsensitive) + indexStr.length(); |
||||
int end = comment.indexOf("\n", start); |
||||
if (end == -1) |
||||
end = comment.length(); |
||||
|
||||
str=comment.mid(start,end-start).trimmed(); |
||||
if (str.isEmpty()) |
||||
return; |
||||
} |
||||
else { |
||||
bool usernameEmpty = entry->username().trimmed().isEmpty(); |
||||
SecString password=entry->password(); |
||||
password.unlock(); |
||||
bool passwordEmpty = password.string().trimmed().isEmpty(); |
||||
if (usernameEmpty && passwordEmpty) |
||||
return; |
||||
else if (usernameEmpty) |
||||
str="{PASSWORD}{ENTER}"; |
||||
else if (passwordEmpty) |
||||
str="{USERNAME}{ENTER}"; |
||||
else |
||||
str="{USERNAME}{TAB}{PASSWORD}{ENTER}"; |
||||
} |
||||
|
||||
QList<AutoTypeAction> Keys; |
||||
for(int i=0;i<str.size();i++){ |
||||
if(str[i]=='{'){ |
||||
QString tmpl; |
||||
i++; |
||||
while(str[i]!='}' && i<str.size()){ |
||||
tmpl += str[i]; |
||||
i++; |
||||
} |
||||
if(i>=str.size()){ |
||||
qWarning("Syntax Error in Auto-Type sequence near character %d\nFound '{' without closing '}'", i+10); |
||||
return; |
||||
} |
||||
templateToKeysyms(tmpl.toLower(),Keys,entry); |
||||
continue; |
||||
} |
||||
else{ |
||||
Keys << AutoTypeAction(TypeKey, str[i].unicode()); |
||||
} |
||||
} |
||||
|
||||
if (hideWindow) |
||||
mainWin->hide(); |
||||
|
||||
QApplication::processEvents(); |
||||
sleepTime(config->autoTypePreGap()); |
||||
|
||||
QString type; |
||||
for(int i=0;i<Keys.size();i++){ |
||||
if (Keys[i].type==TypeKey){ |
||||
SendKeyPressedEvent(Keys[i].data, 0); |
||||
sleepKeyStrokeDelay(); |
||||
} |
||||
else if (Keys[i].type==Delay){ |
||||
QApplication::processEvents(); |
||||
sleepTime(Keys[i].data); |
||||
} |
||||
} |
||||
|
||||
if (config->lockOnMinimize()){ |
||||
if (hideWindow || wasLocked){ |
||||
if ( !(config->showSysTrayIcon() && config->minimizeTray()) ) |
||||
mainWin->showMinimized(); |
||||
else |
||||
mainWin->OnUnLockWorkspace(); |
||||
} |
||||
} |
||||
else{ |
||||
if (hideWindow && !(config->showSysTrayIcon() && config->minimizeTray()) ) |
||||
mainWin->showMinimized(); |
||||
if (wasLocked) |
||||
mainWin->OnUnLockWorkspace(); |
||||
} |
||||
} |
||||
|
||||
void AutoTypeX11::sleepTime(int msec){ |
||||
if (msec==0) return; |
||||
timespec timeOut, remains; |
||||
timeOut.tv_sec = msec/1000; |
||||
timeOut.tv_nsec = (msec%1000)*1000000; |
||||
nanosleep(&timeOut, &remains); |
||||
} |
||||
|
||||
void AutoTypeX11::templateToKeysyms(const QString& tmpl, QList<AutoTypeAction>& keys,IEntryHandle* entry){ |
||||
//tmpl must be lower case!!!
|
||||
if(!tmpl.compare("title")){ |
||||
stringToKeysyms(entry->title(),keys); |
||||
return; |
||||
} |
||||
if(!tmpl.compare("username")){ |
||||
stringToKeysyms(entry->username(),keys); |
||||
return; |
||||
} |
||||
if(!tmpl.compare("url")){ |
||||
stringToKeysyms(entry->url(),keys); |
||||
return; |
||||
} |
||||
if(!tmpl.compare("password")){ |
||||
SecString password=entry->password(); |
||||
password.unlock(); |
||||
stringToKeysyms(password,keys); |
||||
return; |
||||
} |
||||
if(!tmpl.compare("space")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym(' ')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("backspace") || !tmpl.compare("bs") || !tmpl.compare("bksp")){ |
||||
keys << AutoTypeAction(TypeKey, XK_BackSpace); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("break")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Break); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("capslock")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Caps_Lock); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("del") || !tmpl.compare("delete")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Delete); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("end")){ |
||||
keys << AutoTypeAction(TypeKey, XK_End); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("enter")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Return); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("esc")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Escape); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("help")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Help); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("home")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Home); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("insert") || !tmpl.compare("ins")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Insert); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("numlock")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Num_Lock); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("scroll")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Scroll_Lock); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("pgdn")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Page_Down); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("pgup")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Page_Up); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("prtsc")){ |
||||
keys << AutoTypeAction(TypeKey, XK_3270_PrintScreen); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("up")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Up); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("down")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Down); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("left")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Left); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("right")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Right); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f1")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F1); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f2")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F2); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f3")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F3); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f4")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F4); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f5")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F5); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f6")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F6); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f7")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F7); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f8")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F8); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f9")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F9); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f10")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F10); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f11")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F11); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f12")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F12); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f13")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F13); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f14")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F14); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f15")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F15); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("f16")){ |
||||
keys << AutoTypeAction(TypeKey, XK_F16); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("add") || !tmpl.compare("plus")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('+')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("subtract")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('-')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("multiply")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('+')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("divide")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('/')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("at")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('@')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("percent")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('%')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("caret")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('^')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("tilde")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('~')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("leftbrace")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('{')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("rightbrace")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('}')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("leftparen")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym('(')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("rightparen")){ |
||||
keys << AutoTypeAction(TypeKey, HelperX11::getKeysym(')')); |
||||
return; |
||||
} |
||||
|
||||
if(!tmpl.compare("winl")){ |
||||
keys << AutoTypeAction(TypeKey, XK_Super_L); |
||||
return; |
||||