InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IShortcutContext Class Referenceabstract

#include <IShortcutContext.h>

Inheritance diagram for IShortcutContext:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISHORTCUTCONTEXT }
 

Public Member Functions

virtual PMString GetShortcutContextString () const =0
 
virtual PMString GetNextContextString (const VirtualKey &key, int16 currentModifiers) const =0
 
virtual VirtualKey RemapShortcutKey (const VirtualKey &key, int16 *pModifiers) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This interface is part of our support for 'shortcut contexts' whereby the same key combo can do different things in different contexts. For example, the arrow keys move around the text when in text context, but nudge the selected item around on the page when in default context. Typically, 3rd parties would not need to use/implement this interface, unless they're adding a new shorcut context, in which case they'll have to create a new implementation of this interface, and put it on a boss supporting kShortcutContextService

Member Function Documentation

virtual PMString IShortcutContext::GetNextContextString (const VirtualKeykey,
int16 currentModifiers 
) const
pure virtual

returns the string for the context to try if no shortcut was found in this context. Most common is "" to stop looking, or kDefaultContext to look at the shortcuts in the default context

Parameters
keyThe virtual key we're checking shortcuts for
currentModifiersThe modifiers we're checking shortcuts for.
See Also
KBSCModifierDefs.h
Returns
the string for the next context to look in
virtual PMString IShortcutContext::GetShortcutContextString () const
pure virtual

returns the string for this context. If empty, context will be ignored.

Returns
string describing this context
virtual VirtualKey IShortcutContext::RemapShortcutKey (const VirtualKeykey,
int16 * pModifiers 
) const
pure virtual

Gives the shortcut context an opportunity to modify the key and modifiers before they're used to look up the associated action. This is used by the text context to treat the arrow keys differently in horizontal vs. vertical text.

Parameters
keyThe virtual key we're checking shortcuts for
pModifiersThe modifiers we're checking shortcuts for.
See Also
KBSCModifierDefs.h
Returns
the remapped virtual key