summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Čerman <ondrej.cerman@gmail.com>2019-12-28 20:10:19 +0100
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-12-29 21:46:38 -0800
commit7ce402816759c564139a086bc126445ca08dcd31 (patch)
treebd830de416c76c4ec41840e7b59909e379dc9309
parentc2734671251b94e8cb39963f25aa1c7f86149916 (diff)
inputdevices: Added audio type
-rw-r--r--modules/devices/inputdevices.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/devices/inputdevices.c b/modules/devices/inputdevices.c
index 1eb95b2f..12a406b2 100644
--- a/modules/devices/inputdevices.c
+++ b/modules/devices/inputdevices.c
@@ -27,11 +27,12 @@ static struct {
char *name;
char *icon;
} input_devices[] = {
+ { "Unknown", "module.png" },
{ "Keyboard", "keyboard.png" },
{ "Joystick", "joystick.png" },
{ "Mouse", "mouse.png" },
- { "Speaker", "audio.png" },
- { "Unknown", "module.png" },
+ { "Speaker", "audio.png" },
+ { "Audio", "audio.png" }
};
void
@@ -74,17 +75,20 @@ __scan_input_devices(void)
break;
case 'H':
if (strstr(tmp, "kbd"))
- d = 0; //INPUT_KEYBOARD;
+ d = 1; //INPUT_KEYBOARD;
else if (strstr(tmp, "js"))
- d = 1; //INPUT_JOYSTICK;
+ d = 2; //INPUT_JOYSTICK;
else if (strstr(tmp, "mouse"))
- d = 2; //INPUT_MOUSE;
+ d = 3; //INPUT_MOUSE;
else
- d = 4; //INPUT_UNKNOWN;
+ d = 0; //INPUT_UNKNOWN;
break;
case '\n':
if (name && strstr(name, "PC Speaker")) {
- d = 3; // INPUT_PCSPKR
+ d = 4; // INPUT_PCSPKR
+ }
+ if (d == 0 && g_strcmp0(phys, "ALSA")) {
+ d = 5; // INPUT_PCSPKR
}
if (vendor > 0 && product > 0 && g_str_has_prefix(phys, "usb-")) {