Esempio n. 1
0
int JoyEvdev::Activate(InitInfo *args)
{
    AllocState();

    uint16_t size = m_abs.size() + m_rel.size() + m_btn.size();
    memset(physicalControlState, 0, sizeof(int) * size);

    active = 1;
    return 1;
}
Esempio n. 2
0
void WindowsKeyboard::InitState() {
	AllocState();
	for (int vkey=5; vkey<256; vkey++) {
		int value = (unsigned short)(((short)GetAsyncKeyState(vkey))>>15);
		value += value&1;
		if (vkey == VK_CONTROL || vkey == VK_MENU || vkey == VK_SHIFT) {
			value = 0;
		}
		physicalControlState[vkey] = value;
	}
}