JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::ApplicationCommandTarget::InvocationInfo Struct Reference

Contains contextual details about the invocation of a command. More...

#include <juce_ApplicationCommandTarget.h>

Collaboration diagram for juce::ApplicationCommandTarget::InvocationInfo:

Public Types

enum  InvocationMethod {
  direct = 0,
  fromKeyPress,
  fromMenu,
  fromButton
}
 The types of context in which the command might be called. More...
 

Public Member Functions

 InvocationInfo (const CommandID commandID)
 

Public Attributes

int commandFlags
 The command's flags. More...
 
CommandID commandID
 The UID of the command that should be performed. More...
 
InvocationMethod invocationMethod
 The type of event that triggered this command. More...
 
bool isKeyDown
 True if the callback is being invoked when the key is pressed, false if the key is being released. More...
 
KeyPress keyPress
 The keypress that was used to invoke it. More...
 
int millisecsSinceKeyPressed
 If the key is being released, this indicates how long it had been held down for. More...
 
ComponentoriginatingComponent
 If triggered by a keypress or menu, this will be the component that had the keyboard focus at the time. More...
 

Detailed Description

Contains contextual details about the invocation of a command.

Member Enumeration Documentation

◆ InvocationMethod

The types of context in which the command might be called.

Enumerator
direct 

The command is being invoked directly by a piece of code.

fromKeyPress 

The command is being invoked by a key-press.

fromMenu 

The command is being invoked by a menu selection.

fromButton 

The command is being invoked by a button click.

Constructor & Destructor Documentation

◆ InvocationInfo()

juce::ApplicationCommandTarget::InvocationInfo::InvocationInfo ( const CommandID  commandID)

Member Data Documentation

◆ commandFlags

int juce::ApplicationCommandTarget::InvocationInfo::commandFlags

The command's flags.

See ApplicationCommandInfo for a description of these flag values.

◆ commandID

CommandID juce::ApplicationCommandTarget::InvocationInfo::commandID

The UID of the command that should be performed.

◆ invocationMethod

InvocationMethod juce::ApplicationCommandTarget::InvocationInfo::invocationMethod

The type of event that triggered this command.

◆ isKeyDown

bool juce::ApplicationCommandTarget::InvocationInfo::isKeyDown

True if the callback is being invoked when the key is pressed, false if the key is being released.

See also
KeyPressMappingSet::addCommand()

◆ keyPress

KeyPress juce::ApplicationCommandTarget::InvocationInfo::keyPress

The keypress that was used to invoke it.

Note that this will be an invalid keypress if the command was invoked by some other means than a keyboard shortcut.

◆ millisecsSinceKeyPressed

int juce::ApplicationCommandTarget::InvocationInfo::millisecsSinceKeyPressed

If the key is being released, this indicates how long it had been held down for.

(Only relevant if isKeyDown is false.)

◆ originatingComponent

Component* juce::ApplicationCommandTarget::InvocationInfo::originatingComponent

If triggered by a keypress or menu, this will be the component that had the keyboard focus at the time.

If triggered by a button, it may be set to that component, or it may be null.


The documentation for this struct was generated from the following file: