示例#1
0
void JsFile::Input(const js_event &e)
{
    bool init = e.type & JS_EVENT_INIT;
    switch (e.type & ~JS_EVENT_INIT)
    {
        case JS_EVENT_BUTTON:
            if (e.number < m_inputJoystick->NumButtons())
                m_inputJoystick->GetButton(e.number)->Input(
                        e.time, e.value, init);
            break;
        case JS_EVENT_AXIS:
            if (e.number < m_inputJoystick->NumAxes())
                m_inputJoystick->GetAxis(e.number)->Input(
                        e.time, e.value, init);
            break;
    }
}