~aacid/unity-2d/lenses_shortcuts

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/hotkey.h

[HUD] Read the unity setting for hud toggling

For that we need to introduce a parser of the gsettings unity conf key and modify the hotmodifier so it supports multiple modifiers (like shift + alt). Fixes: https://bugs.launchpad.net/bugs/969256. Approved by Pawel Stolowski.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    friend class HotkeyMonitor;
28
28
 
29
29
    Q_OBJECT
30
 
    Q_PROPERTY(Qt::Key key READ key NOTIFY keyChanged)
 
30
    Q_PROPERTY(int key READ key NOTIFY keyChanged)
31
31
    Q_PROPERTY(Qt::KeyboardModifiers modifiers READ modifiers NOTIFY modifiersChanged)
32
32
 
33
33
public:
34
 
    Qt::Key key() const { return m_key; }
 
34
    int key() const { return m_key; }
 
35
    uint x11key() const { return m_x11key; }
35
36
    Qt::KeyboardModifiers modifiers() const { return m_modifiers; }
36
37
 
37
38
Q_SIGNALS:
38
 
    void keyChanged(Qt::Key key);
 
39
    void keyChanged(int key);
39
40
    void modifiersChanged(Qt::KeyboardModifiers modifiers);
40
41
    void pressed();
41
42
    void released();
46
47
 
47
48
private:
48
49
    Hotkey(Qt::Key key, Qt::KeyboardModifiers modifiers, QObject *parent);
 
50
    Hotkey(uint x11key, Qt::KeyboardModifiers modifiers, QObject *parent);
49
51
    bool processNativeEvent(uint x11Keycode, uint x11Modifiers, bool isPressEvent);
 
52
    void translateModifiers(Qt::KeyboardModifiers modifiers);
50
53
 
51
54
private:
52
55
    uint m_connections;
53
 
    Qt::Key m_key;
 
56
    int m_key;
54
57
    Qt::KeyboardModifiers m_modifiers;
55
58
    uint m_x11key;
56
59
    uint m_x11modifiers;