com.esri.arcgis.framework
Interface IAccelerator

All Superinterfaces:
Serializable
All Known Implementing Classes:
Accelerator, IAcceleratorProxy

public interface IAccelerator
extends Serializable

Provides access to members that define an accelerator.

Description

An accelerator is a mapping between a particular keyboard combination and a command. When you press the combination of keys on the keyboard, the command is executed. For example, Ctrl-C is a well-known accelerator for copying something in Windows. Some commands in the application already have accelerators assigned to them but you can also assign additional accelerators to these commands.

Use the IAcceleratorTable::Add method to create an accelerator.

Remarks

The following example prints the keyboard accelerator assigned to the built-in Copy command. You would get m_app from the hook in ICommand::OnCreate().

Product Availability

Available with ArcGIS Desktop.

See Also:
IAcceleratorTable.getItem(int), IAcceleratorTable.findByKey(int, boolean, boolean, boolean), IAcceleratorTable.add(java.lang.Object, int, boolean, boolean, boolean)

Method Summary
 void delete()
          Removes this accelerator from the accelerator table.
 Object getCommandID()
          The identifier of the command that this accelerator activates.
 int getKey()
          The keycode for this accelerator.
 boolean isAlt()
          Indicates if the Alt key is pressed for this accelerator.
 boolean isCtrl()
          Indicates if the Ctrl key is pressed for this accelerator.
 boolean isShift()
          Indicates if the Shift key is pressed for this accelerator.
 void setAlt(boolean bAlt)
          Indicates if the Alt key is pressed for this accelerator.
 void setCommandID(Object cmdID)
          The identifier of the command that this accelerator activates.
 void setCtrl(boolean bCtrl)
          Indicates if the Ctrl key is pressed for this accelerator.
 void setKey(int keyCode)
          The keycode for this accelerator.
 void setShift(boolean bShift)
          Indicates if the Shift key is pressed for this accelerator.
 

Method Detail

setShift

void setShift(boolean bShift)
              throws IOException,
                     AutomationException
Indicates if the Shift key is pressed for this accelerator.

Remarks

Use True if the Shift key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
bShift - The bShift (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isShift

boolean isShift()
                throws IOException,
                       AutomationException
Indicates if the Shift key is pressed for this accelerator.

Description



Remarks

Use True if the Shift key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The bShift
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAlt

void setAlt(boolean bAlt)
            throws IOException,
                   AutomationException
Indicates if the Alt key is pressed for this accelerator.

Remarks

Use True if the Alt key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
bAlt - The bAlt (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isAlt

boolean isAlt()
              throws IOException,
                     AutomationException
Indicates if the Alt key is pressed for this accelerator.

Remarks

Use True if the Alt key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The bAlt
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCtrl

void setCtrl(boolean bCtrl)
             throws IOException,
                    AutomationException
Indicates if the Ctrl key is pressed for this accelerator.

Remarks

Use True if the Ctrl key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
bCtrl - The bCtrl (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isCtrl

boolean isCtrl()
               throws IOException,
                      AutomationException
Indicates if the Ctrl key is pressed for this accelerator.

Remarks

Use True if the Ctrl key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The bCtrl
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setKey

void setKey(int keyCode)
            throws IOException,
                   AutomationException
The keycode for this accelerator.

Remarks

Use the Visual Basic Key Code constants for the value of Key. For example, the VB Key Code constant vbKeyA would be used for value if your accelerator key is A.

Here is an example of how to set the Key value of an Accelerator to the A key.
anAccelerator.Key = vbKeyA 

Here is an example of how to get the Key value of an Accelerator.
Dim x as Long

x = anAccelerator.Key 

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
keyCode - The keyCode (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getKey

int getKey()
           throws IOException,
                  AutomationException
The keycode for this accelerator.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The keyCode
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCommandID

void setCommandID(Object cmdID)
                  throws IOException,
                         AutomationException
The identifier of the command that this accelerator activates.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
cmdID - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCommandID

Object getCommandID()
                    throws IOException,
                           AutomationException
The identifier of the command that this accelerator activates.

Description

value specifies the unique identifier of the command. For built-in commands, use the UID. For VBA macros and UIControls, use a string representing the full name of the command.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

delete

void delete()
            throws IOException,
                   AutomationException
Removes this accelerator from the accelerator table.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.