~josephjamesmills/u2t/trunk

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/hotkeymonitor.cpp

  • Committer: Michał Sawicz
  • Date: 2012-04-13 11:49:14 UTC
  • Revision ID: michal.sawicz@canonical.com-20120413114914-de64smwjwsq50zu1
Merge lp:unity-2d r1030

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
    return hotkey;
79
79
}
80
80
 
 
81
Hotkey*
 
82
HotkeyMonitor::getHotkeyFor(uint x11Keycode, Qt::KeyboardModifiers modifiers)
 
83
{
 
84
    Q_FOREACH(Hotkey* currentHotkey, m_hotkeys) {
 
85
        if (currentHotkey->x11key() == x11Keycode &&
 
86
            currentHotkey->modifiers() == modifiers) {
 
87
            return currentHotkey;
 
88
        }
 
89
    }
 
90
 
 
91
    Hotkey *hotkey = new Hotkey(x11Keycode, modifiers, this);
 
92
    m_hotkeys.append(hotkey);
 
93
    return hotkey;
 
94
}
 
95
 
81
96
void HotkeyMonitor::disableModifiers(Qt::KeyboardModifiers modifiers)
82
97
{
83
98
    m_disabledModifiers |= modifiers;