Skip to content

Commit

Permalink
"[eInputDeviceInit]" don't add input device if already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jbleyel authored and fairbird committed Feb 17, 2025
1 parent 29375ab commit 352db0c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/driver/rcinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ class eInputDeviceInit

void add(const char* filename)
{
for (itemlist::iterator it = items.begin(); it != items.end(); ++it)
{
if (strcmp((*it)->filename, filename) == 0)
{
// Ignore if already exists
return;
}
}
eDebug("[eInputDeviceInit] adding device %s", filename);
eRCInputEventDriver *p = new eRCInputEventDriver(filename);
items.push_back(new element(filename, p, new eRCDeviceInputDev(p, consoleFd)));
Expand Down

0 comments on commit 352db0c

Please sign in to comment.