Closed gezzuzz closed 4 years ago
is it on Raspberry Pi?
is it on Raspberry Pi?
yes..
at command prompt it detects the mouse and keyboard if plugged in after boot... or it removed and replugged in..
it seem what ever you have when you start the program works.. as long as you dont disconnect it
@gezzuzz inputs processing in RPI native is different than other platforms, actually, it has been reviewed several times... Current implementation uses dev events in separate threads to detect inputs...
There is a function in core.c.. InitEvdevInput if i call it. the keyboard starts to work fine. Since its not in raylib.h by default i can not access it.
i was able to make it work by removing Static then i added it to raylib.h RLAPI void InitEvdevInput(void);
Im not sure it this is the proper way.. But i would like to make InitEvdevInput public. Is there is a reason not to make this function public?
i figured i could call this function on a timer so that i can redetect input devices..
Better yet i can check for changes to "/dev/input/" if any devices get added to removed it shows here.. then i call InitEvdevInput to reset everything. (only need for linux)
#if !defined(__x86_64__)
GetDirectoryFiles("/dev/input/",&fileCount);
if(fileCount != lastDeviceCount){
InitEvdevInput();
lastDeviceCount = fileCount;
}
#endif
@gezzuzz that's nice... but for the moment no plans to expose that function...
Closing this issue.
im running raylib in native mode..
When i start my program with mouse and keyboard plugged in at boot.. they work fine.
if i disconnect and reinsert them.. they do not come back.. also if i dont have a keyboard plugged in when i start my program they will not work.
how does raylib detect input devices?
thank you