MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / OnInit

Function OnInit

src/InputHandler.c:978–1001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

976static struct LocalPlayerInput normalInput = { PlayerInputNormal };
977
978static void OnInit(void) {
979 LocalPlayerInput_Add(&normalInput);
980 LocalPlayerInput_Add(&gamepadInput);
981 HookInputBinds();
982
983 Event_Register_(&PointerEvents.Down, NULL, OnPointerDown);
984 Event_Register_(&PointerEvents.Up, NULL, OnPointerUp);
985 Event_Register_(&InputEvents._down, NULL, OnInputDownLegacy);
986 Event_Register_(&InputEvents.Down2, NULL, OnInputDown);
987 Event_Register_(&InputEvents.Up2, NULL, OnInputUp);
988
989 Event_Register_(&UserEvents.HackPermsChanged, NULL, InputHandler_CheckZoomFov);
990 StoredHotkeys_LoadAll();
991
992 Bind_OnTriggered[BIND_FORWARD] = Player_TriggerUp;
993 Bind_OnTriggered[BIND_BACK] = Player_TriggerDown;
994 Bind_OnTriggered[BIND_LEFT] = Player_TriggerLeft;
995 Bind_OnTriggered[BIND_RIGHT] = Player_TriggerRight;
996
997 Bind_OnReleased[BIND_FORWARD] = Player_ReleaseUp;
998 Bind_OnReleased[BIND_BACK] = Player_ReleaseDown;
999 Bind_OnReleased[BIND_LEFT] = Player_ReleaseLeft;
1000 Bind_OnReleased[BIND_RIGHT] = Player_ReleaseRight;
1001}
1002
1003static void OnFree(void) {
1004 HotkeysText.count = 0;

Callers

nothing calls this directly

Calls 3

LocalPlayerInput_AddFunction · 0.85
HookInputBindsFunction · 0.85
StoredHotkeys_LoadAllFunction · 0.85

Tested by

no test coverage detected