MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / inputdevice_get_device_index

Function inputdevice_get_device_index

src/inputdevice.cpp:9085–9100  ·  view source on GitHub ↗

device based index from global device index

Source from the content-addressed store, hash-verified

9083
9084// device based index from global device index
9085int inputdevice_get_device_index (int devnum)
9086{
9087 int jcnt = idev[IDTYPE_JOYSTICK].get_num ();
9088 int mcnt = idev[IDTYPE_MOUSE].get_num ();
9089 int kcnt = idev[IDTYPE_KEYBOARD].get_num ();
9090
9091 if (devnum < jcnt)
9092 return devnum;
9093 else if (devnum < jcnt + mcnt)
9094 return devnum - jcnt;
9095 else if (devnum < jcnt + mcnt + kcnt)
9096 return devnum - (jcnt + mcnt);
9097 else if (devnum < jcnt + mcnt + kcnt + INTERNALEVENT_COUNT)
9098 return devnum - (jcnt + mcnt + kcnt);
9099 return -1;
9100}
9101
9102/* returns number of devices of type "type" */
9103int inputdevice_get_device_total (int type)

Callers 11

inputdevice_devicechangeFunction · 0.85
inputdevice_iterateFunction · 0.85
inputdevice_get_mappingFunction · 0.85
inputdevice_set_mappingFunction · 0.85
inputdevice_swap_portsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected