Doxygen Samurai Engine 0.0.1
Doxygen Samurai Engine Documentation
Loading...
Searching...
No Matches
shortcutApi.h
Go to the documentation of this file.
1#pragma once
2#include <unordered_map>
3#include <string>
4
5#include "input/input.h"
6
7
8namespace samurai
9{
10
12 {
13 struct Shortcut
14 {
15 std::string shortcut = "";
16 bool *toggle = 0;
17 bool editable = true;
18 };
19
20 void update(const samurai::Input &input);
21
22 std::unordered_map<std::string, Shortcut> registeredShortcuts;
23
24 bool registerShortcut(const char *name, const char *s, bool *toggle, bool editable = 1);
25
26 const char *getShortcut(const char *name);
27 };
28
29bool shortcut(const samurai::Input &input, const char *shortcut);
30
31bool MenuItem(const samurai::Input &input, const char *label, const char *shortcut, bool *p_selected, bool enabled = true);
32
33std::string normalizeShortcutName(const char *shortcut);
34
35void initShortcutApi();
36
37}
bool MenuItem(const samurai::Input &input, const char *label, const char *shortcut, bool *p_selected, bool enabled)
bool shortcut(const samurai::Input &input, const char *shortcut)
std::string normalizeShortcutName(const char *shortcut)
void initShortcutApi()
void update(const samurai::Input &input)
bool registerShortcut(const char *name, const char *s, bool *toggle, bool editable=1)
const char * getShortcut(const char *name)
std::unordered_map< std::string, Shortcut > registeredShortcuts
Definition shortcutApi.h:22