Editor API
UnigineEditor public API
Editor::Controls Class Referencefinal

#include <Controls.h>

Public Types

enum  Context { Context::SHARED = 0, Context::EXCLUSIVE }
 
enum  ControlFlag { MOUSE = 1 << 0, KEYBOARD = 1 << 1, WHEEL = 1 << 2, MODIFIER = 1 << 3 }
 
enum  MouseWheel {
  NONE = 0, MouseWheel::UP, MouseWheel::DOWN, MouseWheel::RIGHT,
  MouseWheel::LEFT
}
 
enum  ModifierFlag {
  NONE = 0, NONE = 0, SHIFT = 1 << 0, CTRL = 1 << 1,
  ALT = 1 << 2, CMD = 1 << 3, MOUSE_LEFT = 1 << 4, MOUSE_RIGHT = 1 << 5,
  MOUSE_MIDDLE = 1 << 6, MOUSE_AUX_0 = 1 << 7, MOUSE_AUX_1 = 1 << 8, MOUSE_AUX_2 = 1 << 9,
  MOUSE_AUX_3 = 1 << 10
}
 
enum  ModifierMatch { ModifierMatch::EXACT = 0, ModifierMatch::PARTIAL }
 
using ContextActiveChecker = bool(*)(void *opaque)
 

Static Public Member Functions

static bool createContext (const char *context_id, const char *title, ContextActiveChecker checker, void *opaque, Context context_type=Context::SHARED, int priority=0)
 
static bool removeContext (const char *context_id)
 
static bool hasContext (const char *context_id)
 
static bool createControl (const char *control_id, const char *context_id="global", int control_flags=ControlFlag::MOUSE|ControlFlag::KEYBOARD|ControlFlag::WHEEL)
 
static bool removeControl (const char *control_id)
 
static bool hasControl (const char *control_id)
 
static bool setControlTitle (const char *control_id, const char *title)
 
static bool setControlTooltip (const char *control_id, const char *tooltip)
 
static bool setControlKey (const char *control_id, int key)
 
static bool setControlMouseButton (const char *control_id, int mouse_button)
 
static bool setControlMouseWheel (const char *control_id, MouseWheel wheel)
 
static bool setControlModifierFlags (const char *control_id, int modifier_flags)
 
static bool setControlModifierMatch (const char *control_id, ModifierMatch modifier_match)
 
static bool setControlActivatedCallback (const char *control_id, Unigine::CallbackBase *func)
 
static bool setControlPressedCallback (const char *control_id, Unigine::CallbackBase *func)
 
static bool setControlReleasedCallback (const char *control_id, Unigine::CallbackBase *func)
 
static bool addControlFriend (const char *control_id, const char *friend_control_id)
 
static bool removeControlFriend (const char *control_id, const char *friend_control_id)
 
static bool isControlPressed (const char *control_id)
 
static bool isControlDown (const char *control_id)
 
static bool isControlUp (const char *control_id)
 
static Unigine::String getControlShortcutText (const char *control_id)
 

Member Typedef Documentation

◆ ContextActiveChecker

using Editor::Controls::ContextActiveChecker = bool (*)(void *opaque)

Member Enumeration Documentation

◆ Context

Enumerator
SHARED 
EXCLUSIVE 

◆ ControlFlag

Enumerator
MOUSE 
KEYBOARD 
WHEEL 
MODIFIER 

◆ ModifierFlag

Enumerator
NONE 
NONE 
SHIFT 
CTRL 
ALT 
CMD 
MOUSE_LEFT 
MOUSE_RIGHT 
MOUSE_MIDDLE 
MOUSE_AUX_0 
MOUSE_AUX_1 
MOUSE_AUX_2 
MOUSE_AUX_3 

◆ ModifierMatch

Enumerator
EXACT 
PARTIAL 

◆ MouseWheel

Enumerator
NONE 
UP 
DOWN 
RIGHT 
LEFT 

Member Function Documentation

◆ addControlFriend()

static bool Editor::Controls::addControlFriend ( const char *  control_id,
const char *  friend_control_id 
)
static

◆ createContext()

static bool Editor::Controls::createContext ( const char *  context_id,
const char *  title,
ContextActiveChecker  checker,
void *  opaque,
Context  context_type = Context::SHARED,
int  priority = 0 
)
static

◆ createControl()

static bool Editor::Controls::createControl ( const char *  control_id,
const char *  context_id = "global",
int  control_flags = ControlFlag::MOUSE|ControlFlag::KEYBOARD|ControlFlag::WHEEL 
)
static

◆ getControlShortcutText()

static Unigine::String Editor::Controls::getControlShortcutText ( const char *  control_id)
static

◆ hasContext()

static bool Editor::Controls::hasContext ( const char *  context_id)
static

◆ hasControl()

static bool Editor::Controls::hasControl ( const char *  control_id)
static

◆ isControlDown()

static bool Editor::Controls::isControlDown ( const char *  control_id)
static

◆ isControlPressed()

static bool Editor::Controls::isControlPressed ( const char *  control_id)
static

◆ isControlUp()

static bool Editor::Controls::isControlUp ( const char *  control_id)
static

◆ removeContext()

static bool Editor::Controls::removeContext ( const char *  context_id)
static

◆ removeControl()

static bool Editor::Controls::removeControl ( const char *  control_id)
static

◆ removeControlFriend()

static bool Editor::Controls::removeControlFriend ( const char *  control_id,
const char *  friend_control_id 
)
static

◆ setControlActivatedCallback()

static bool Editor::Controls::setControlActivatedCallback ( const char *  control_id,
Unigine::CallbackBase *  func 
)
static

◆ setControlKey()

static bool Editor::Controls::setControlKey ( const char *  control_id,
int  key 
)
static

◆ setControlModifierFlags()

static bool Editor::Controls::setControlModifierFlags ( const char *  control_id,
int  modifier_flags 
)
static

◆ setControlModifierMatch()

static bool Editor::Controls::setControlModifierMatch ( const char *  control_id,
ModifierMatch  modifier_match 
)
static

◆ setControlMouseButton()

static bool Editor::Controls::setControlMouseButton ( const char *  control_id,
int  mouse_button 
)
static

◆ setControlMouseWheel()

static bool Editor::Controls::setControlMouseWheel ( const char *  control_id,
MouseWheel  wheel 
)
static

◆ setControlPressedCallback()

static bool Editor::Controls::setControlPressedCallback ( const char *  control_id,
Unigine::CallbackBase *  func 
)
static

◆ setControlReleasedCallback()

static bool Editor::Controls::setControlReleasedCallback ( const char *  control_id,
Unigine::CallbackBase *  func 
)
static

◆ setControlTitle()

static bool Editor::Controls::setControlTitle ( const char *  control_id,
const char *  title 
)
static

◆ setControlTooltip()

static bool Editor::Controls::setControlTooltip ( const char *  control_id,
const char *  tooltip 
)
static