1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_
6 #define CHROME_BROWSER_UI_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_
8 #import <AppKit/AppKit.h>
12 struct KeyEquivalentAndModifierMask
{
14 KeyEquivalentAndModifierMask() : charCode(nil
), mask(0) {}
19 // MultiKeyEquivalentButton is an NSButton subclass that is capable of
20 // responding to additional key equivalents. It will respond to the ordinary
21 // NSButton key equivalent set by -setKeyEquivalent: and
22 // -setKeyEquivalentModifierMask:, and it will also respond to any additional
23 // equivalents provided to it in a KeyEquivalentAndModifierMask structure
24 // passed to -addKeyEquivalent:.
26 @interface MultiKeyEquivalentButton
: NSButton
{
28 std::vector
<KeyEquivalentAndModifierMask
> extraKeys_
;
31 - (void)addKeyEquivalent
:(KeyEquivalentAndModifierMask
)key
;
35 #endif // CHROME_BROWSER_UI_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_