24 lines
641 B
C++
24 lines
641 B
C++
#include <mods/input/input.h>
|
|
#include <symbols/minecraft.h>
|
|
#include <libreborn/libreborn.h>
|
|
#include <SDL/SDL.h>
|
|
|
|
#include "input-internal.h"
|
|
|
|
// Translator
|
|
static int32_t sdl_key_to_minecraft_key_injection(Common_sdl_key_to_minecraft_key_t original, const int32_t sdl_key) {
|
|
switch (sdl_key) {
|
|
#define KEY(name, value) case SDLK_##name: return MC_KEY_##name;
|
|
#include <mods/input/key-list.h>
|
|
#undef KEY
|
|
default: {
|
|
// Call Original Method
|
|
return original(sdl_key);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Init
|
|
void _init_keys() {
|
|
overwrite_calls(Common_sdl_key_to_minecraft_key, sdl_key_to_minecraft_key_injection);
|
|
} |