diff --git a/README.txt b/README.txt index 823a8b3..3f0ea3f 100644 --- a/README.txt +++ b/README.txt @@ -904,17 +904,8 @@ Chapter 6. Credits Thank you for your interest and for your support, Mark. _________________________________________________________ -Chapter 7. This software is GPL! +Chapter 7. Licensing + + This software is licensed under the terms of the GNU GPLv2. + Please see LICENSE.txt for a full text of the license. - Check out LICENSE.txt or http://www.gnu.org/licenses/gpl.txt - for details! The bare bones of it is, this program is - distributed in open-source form so that others may share it - freely, learn from it, or modify it as they see fit. However, - under no circumstances can it be sold! - - This code was written entirely by Nathan Gaylinn (excepting - the code used for displaying a tray icon that is adapted from - the Psi source [http://psi.affinix.com/]) but is based on the - idea of xjoypad by Erich Kitzmüller. - - Yay for the power GPL gives to developers! diff --git a/src/getkey.cpp b/src/getkey.cpp index d4d6660..97281c5 100644 --- a/src/getkey.cpp +++ b/src/getkey.cpp @@ -31,7 +31,6 @@ bool GetKey::x11Event( XEvent* e ) { //keep Qt from closing the dialog upon seeing Esc pressed. if (e->type == KeyPress) return true; - //On a key press, return the key and quit //Ctrl+X == [No Key] if (e->type == KeyRelease) { @@ -53,6 +52,11 @@ bool GetKey::x11Event( XEvent* e ) return false; } +void GetKey::closeEvent(QCloseEvent *e) { + e->ignore(); + done(-1); +} + void GetKey::paintEvent ( QPaintEvent * ) { //whenever we need to repaint, draw in our text. QPainter paint( this ); diff --git a/src/getkey.h b/src/getkey.h index 35e0b74..a2c16ca 100644 --- a/src/getkey.h +++ b/src/getkey.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "constant.h" #include //The KeySym for "x" @@ -21,6 +22,7 @@ class GetKey : public QDialog { //to avoid focus issues, there is only the dialog widget, all the //rest is painted on. So, I need to know when to repaint. void paintEvent ( QPaintEvent * ); + void closeEvent (QCloseEvent *); private: //the dialog's message QString Text; diff --git a/src/keycode.cpp b/src/keycode.cpp index b454b52..9801998 100644 --- a/src/keycode.cpp +++ b/src/keycode.cpp @@ -90,7 +90,14 @@ KeyButton::KeyButton( QString name, int val, QWidget* parent, bool m, bool nowMo void KeyButton::onClick() { //when clicked, ask for a key! - value = GetKey( buttonname, mouse ).exec(); + int retValue = GetKey( buttonname, mouse ).exec(); + // -1 is a special value meaning that the window was simply + // closed so we can ignore this + if(retValue == -1) { + return; + } else { + value = retValue; + } //if the return value was a mouse click... if (value > MOUSE_OFFSET) { mouseClicked = true;