MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / init

Method init

src/server/gui/core/InputManager.cpp:51–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void InputManager::init()
52{
53 if(initialized())
54 deinit();
55
56 SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
57 Settings::getInstance()->getBool("BackgroundJoystickInput") ? "1" : "0");
58 SDL_InitSubSystem(SDL_INIT_JOYSTICK);
59 SDL_JoystickEventState(SDL_ENABLE);
60
61 // first, open all currently present joysticks
62 int numJoysticks = SDL_NumJoysticks();
63 for(int i = 0; i < numJoysticks; i++)
64 {
65 addJoystickByDeviceIndex(i);
66 }
67
68 mKeyboardInputConfig = new InputConfig(DEVICE_KEYBOARD, "Keyboard", KEYBOARD_GUID_STRING);
69 loadInputConfig(mKeyboardInputConfig);
70
71 SDL_USER_CECBUTTONDOWN = SDL_RegisterEvents(2);
72 SDL_USER_CECBUTTONUP = SDL_USER_CECBUTTONDOWN + 1;
73 CECInput::init();
74 mCECInputConfig = new InputConfig(DEVICE_CEC, "CEC", CEC_GUID_STRING);
75 loadInputConfig(mCECInputConfig);
76}
77
78void InputManager::addJoystickByDeviceIndex(int id)
79{

Callers

nothing calls this directly

Calls 2

deinitFunction · 0.85
initFunction · 0.85

Tested by

no test coverage detected