Libmacro  0.2
Libmacro is an extensible macro and hotkey library.
mod_flags.h File Reference

mcr_ModFlags - Flag enumeration for modifiers More...

#include "mcr/base/types.h"

Go to the source code of this file.

Enumerations

enum  mcr_ModFlags {
  MCR_MF_NONE = 0, MCR_ALT = 1, MCR_OPTION = 1, MCR_ALTGR = 1 << 1,
  MCR_AMIGA = 1 << 2, MCR_CMD = 1 << 3, MCR_CODE = 1 << 4, MCR_COMPOSE = 1 << 5,
  MCR_CTRL = 1 << 6, MCR_FN = 1 << 7, MCR_FRONT = 1 << 8, MCR_GRAPH = 1 << 9,
  MCR_HYPER = 1 << 10, MCR_META = 1 << 11, MCR_SHIFT = 1 << 12, MCR_SUPER = 1 << 13,
  MCR_SYMBOL = 1 << 14, MCR_TOP = 1 << 15, MCR_WIN = 1 << 16, MCR_MF_USER = MCR_WIN << 1
}
 

Functions

MCR_API unsigned int mcr_ModFlags_combine (const unsigned int *modsArray, size_t length)
 
MCR_API unsigned int mcr_ModFlags_add (unsigned int mods, unsigned int newMod)
 
MCR_API bool mcr_ModFlags_has (unsigned int mods, unsigned int modVal)
 
MCR_API unsigned int mcr_ModFlags_remove (unsigned int mods, unsigned int delMod)
 

Detailed Description

mcr_ModFlags - Flag enumeration for modifiers

Definition in file mod_flags.h.

Enumeration Type Documentation

§ mcr_ModFlags

Enumeration for known and historical modifiers.

To emulate how an operating system combines the names of some modifiers, the names of those modifiers will map to the same value.
Some of these are actually hardware switches, depending on the keyboard. If relying on keyboard or key codes to set modifiers, some may never be used.
These values may change. Other values may also be defined in other modules.

Enumerator
MCR_MF_NONE 

Interpreted as no modifiers

Definition at line 42 of file mod_flags.h.

Function Documentation

§ mcr_ModFlags_add()

MCR_API unsigned int mcr_ModFlags_add ( unsigned int  mods,
unsigned int  newMod 
)

Combine two flags

Parameters
modsFirst set of flags
newModAdditional set of flags
Returns
Combined flags

§ mcr_ModFlags_combine()

MCR_API unsigned int mcr_ModFlags_combine ( const unsigned int *  modsArray,
size_t  length 
)

Combine an array of flags

Parameters
modsArrayopt Array of flags
lengthNumber of flags to combine
Returns
Combined flags

§ mcr_ModFlags_has()

MCR_API bool mcr_ModFlags_has ( unsigned int  mods,
unsigned int  modVal 
)

True if flags contain a set of other flags

Parameters
modsCurrent set of flags
modValFlags to be contained or not
Returns
True if flags contain a set of other flags

§ mcr_ModFlags_remove()

MCR_API unsigned int mcr_ModFlags_remove ( unsigned int  mods,
unsigned int  delMod 
)

Remove one set of flags from another

Parameters
modsCurrent set of flags
delModFlags to remove
Returns
Current mods with the others removed