diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /khotkeys/shared/input.h | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khotkeys/shared/input.h')
-rw-r--r-- | khotkeys/shared/input.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/khotkeys/shared/input.h b/khotkeys/shared/input.h new file mode 100644 index 000000000..1983bcf0b --- /dev/null +++ b/khotkeys/shared/input.h @@ -0,0 +1,87 @@ +/**************************************************************************** + + KHotKeys + + Copyright (C) 1999-2001 Lubos Lunak <[email protected]> + + Distributed under the terms of the GNU General Public License version 2. + +****************************************************************************/ + +#ifndef _INPUT_H_ +#define _INPUT_H_ + +#include <qobject.h> +#include <qwindowdefs.h> +#include <qmap.h> +#include <qwidget.h> +#include <qvaluelist.h> +#include <kshortcut.h> + +#include <X11/X.h> +#include <fixx11h.h> + +class KGlobalAccel; + +namespace KHotKeys +{ + +class Kbd_receiver + { + public: + virtual bool handle_key( const KShortcut& shortcut_P ) = 0; + }; + +class Kbd + : public QObject + { + Q_OBJECT + public: + Kbd( bool grabbing_enabled_P, QObject* parent_P ); + virtual ~Kbd(); + void insert_item( const KShortcut& shortcut_P, Kbd_receiver* receiver_P ); + void remove_item( const KShortcut& shortcut_P, Kbd_receiver* receiver_P ); + void activate_receiver( Kbd_receiver* receiver_P ); + void deactivate_receiver( Kbd_receiver* receiver_P ); + static bool send_macro_key( const KKey& key, Window window_P = InputFocus ); + protected: + bool x11EventFilter( const XEvent* ); + void grab_shortcut( const KShortcut& shortcut_P ); + void ungrab_shortcut( const KShortcut& shortcut_P ); + private slots: + void key_slot( QString key_P ); + void update_connections(); + private: + struct Receiver_data + { + Receiver_data(); + QValueList< KShortcut > shortcuts; + bool active; + }; + QMap< Kbd_receiver*, Receiver_data > receivers; + QMap< KShortcut, int > grabs; + KGlobalAccel* kga; + }; + +class Mouse + { + public: + static bool send_mouse_button( int button_P, bool release_P ); + }; + + +//*************************************************************************** +// Inline +//*************************************************************************** + +// Kbd::Receiver_data + +inline +Kbd::Receiver_data::Receiver_data() + : active( false ) + { + } + +} // namespace KHotKeys + +#endif |