$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
app_binding.h File Reference
#include <GLFW/glfw3.h>
Include dependency graph for app_binding.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  AppBinding
 Definition of a single key binding with its help metadata. More...
 
struct  AppBindingRegistry
 Central registry that holds application key bindings. More...
 

Enumerations

enum  BindingCategory {
  BINDING_CAT_MOVEMENT , BINDING_CAT_VISUALS , BINDING_CAT_POSTFX , BINDING_CAT_SYSTEM ,
  BINDING_CAT_COUNT
}
 Categories for organization in the help UI. More...
 
enum  BindingType { BINDING_TYPE_ACTION , BINDING_TYPE_TOGGLE , BINDING_TYPE_CYCLE , BINDING_TYPE_COUNT }
 Types of actions for color-coding in the UI. More...
 
enum  { MAX_APP_BINDINGS = 128 }
 

Functions

void app_binding_registry_init (AppBindingRegistry *registry)
 Initializes the binding registry and populates it with all application shortcuts. More...
 
const AppBindingapp_binding_registry_get (const AppBindingRegistry *registry, int key, int mods)
 Retrieves the binding for a specific key/mods combination. More...
 
int app_binding_registry_get_count (const AppBindingRegistry *registry)
 Returns the total number of registered bindings. More...
 
const AppBindingapp_binding_registry_at (const AppBindingRegistry *registry, int index)
 Returns a pointer to the binding at the given index. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_APP_BINDINGS 

◆ BindingCategory

Categories for organization in the help UI.

Enumerator
BINDING_CAT_MOVEMENT 
BINDING_CAT_VISUALS 
BINDING_CAT_POSTFX 
BINDING_CAT_SYSTEM 
BINDING_CAT_COUNT 

◆ BindingType

Types of actions for color-coding in the UI.

Enumerator
BINDING_TYPE_ACTION 

Single direct action (default).

BINDING_TYPE_TOGGLE 

On/Off toggle.

BINDING_TYPE_CYCLE 

Cycle through multiple values.

BINDING_TYPE_COUNT 

Function Documentation

◆ app_binding_registry_at()

const AppBinding* app_binding_registry_at ( const AppBindingRegistry registry,
int  index 
)

Returns a pointer to the binding at the given index.

Parameters
registryPointer to the initialized registry.
indexIndex of the binding to retrieve.

◆ app_binding_registry_get()

const AppBinding* app_binding_registry_get ( const AppBindingRegistry registry,
int  key,
int  mods 
)

Retrieves the binding for a specific key/mods combination.

Parameters
registryPointer to the initialized registry.
keyGLFW key code.
modsGLFW modifier flags.
Returns
Pointer to binding, or NULL if not found.

◆ app_binding_registry_get_count()

int app_binding_registry_get_count ( const AppBindingRegistry registry)

Returns the total number of registered bindings.

Parameters
registryPointer to the initialized registry.

◆ app_binding_registry_init()

void app_binding_registry_init ( AppBindingRegistry registry)

Initializes the binding registry and populates it with all application shortcuts.

Parameters
registryPointer to the registry to initialize.