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

Function inputdevice_testread

src/inputdevice.cpp:9845–9868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9843}
9844
9845int inputdevice_testread (int *devnum, int *wtype, int *state, bool doread)
9846{
9847 if (doread) {
9848 inputdevice_read();
9849 if (testmode != 1) {
9850 testmode = 0;
9851 return -1;
9852 }
9853 }
9854 if (testmode_count > 0) {
9855 testmode_count--;
9856 struct teststore *ts = &testmode_data[testmode_count];
9857 *devnum = getdevnum (ts->testmode_type, ts->testmode_num);
9858 if (ts->testmode_wnum >= 0 && ts->testmode_wnum < MAX_INPUT_DEVICE_EVENTS)
9859 *wtype = idev[ts->testmode_type].get_widget_first (ts->testmode_num, ts->testmode_wtype) + ts->testmode_wnum;
9860 else
9861 *wtype = ts->testmode_wnum;
9862 *state = ts->testmode_state;
9863 if (ts->testmode_state)
9864 memcpy (&testmode_wait[testmode_count], ts, sizeof (struct teststore));
9865 return 1;
9866 }
9867 return 0;
9868}
9869
9870/* Call this function when host machine's joystick/joypad/etc button state changes
9871* This function translates button events to Amiga joybutton/joyaxis/keyboard events

Callers

nothing calls this directly

Calls 2

inputdevice_readFunction · 0.85
getdevnumFunction · 0.85

Tested by

no test coverage detected