30 lines
652 B
C
30 lines
652 B
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "console/console.h"
|
|
#include "input/input.h"
|
|
|
|
void cmdBind(const consolecmdexec_t *exec) {
|
|
if(exec->argc < 1) {
|
|
consolePrint("Expected 1 argument: <key> <command]");
|
|
return;
|
|
}
|
|
|
|
if(exec->argc == 1) {
|
|
consolePrint("TODO: Show binds");
|
|
return;
|
|
}
|
|
|
|
inputbutton_t button = inputButtonGetByName(exec->argv[0]);
|
|
if(button.type == INPUT_BUTTON_TYPE_NONE) {
|
|
consolePrint("Unknown button \"%s\"", exec->argv[0]);
|
|
return;
|
|
}
|
|
|
|
inputBind(button, exec->argv[1]);
|
|
} |