mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-17 05:50:07 +00:00
Add map function to create controller mappings
This commit is contained in:
12
src/main.c
12
src/main.c
@@ -139,6 +139,7 @@ static void help() {
|
||||
printf("\tstream\t\t\tStream computer to device\n");
|
||||
printf("\tlist\t\t\tList available games and applications\n");
|
||||
printf("\tquit\t\t\tQuit the application or game being streamed\n");
|
||||
printf("\tmap\t\t\tCreate mapping file for gamepad\n");
|
||||
printf("\thelp\t\t\tShow this help\n");
|
||||
printf("\n Global Options\n\n");
|
||||
printf("\t-config <config>\tLoad configuration file\n");
|
||||
@@ -194,6 +195,17 @@ int main(int argc, char* argv[]) {
|
||||
if (config.debug_level > 0)
|
||||
printf("Moonlight Embedded %d.%d.%d (%s)\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, COMPILE_OPTIONS);
|
||||
|
||||
if (strcmp("map", config.action) == 0) {
|
||||
if (config.inputsCount != 1) {
|
||||
printf("You need to specify one input device using -input.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
evdev_create(config.inputs[0], NULL, config.debug_level > 0);
|
||||
evdev_map(config.inputs[0]);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (config.address == NULL) {
|
||||
config.address = malloc(MAX_ADDRESS_SIZE);
|
||||
if (config.address == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user