
#include <WFX/input/InputHandler.h>

using namespace WFX;
using namespace WFX::input;

void InputHandler::keyPressed(KeyEvent k) {
    std::list<KeyboardListener*>::iterator it;
    for (it=KeyboardListeners.begin();it!=KeyboardListeners.end();it++) {
        (*it)->keyPressed(k);
    }
}

void InputHandler::keyReleased(KeyEvent k) {
    std::list<KeyboardListener*>::iterator it;
    for (it=KeyboardListeners.begin();it!=KeyboardListeners.end();it++) {
        (*it)->keyReleased(k);
    }
}

void InputHandler::buttonPressed(JoystickButtonEvent j) {
    std::list<JoystickListener*>::iterator it;
    for (it=JoystickListeners.begin();it!=JoystickListeners.end();it++) {
        (*it)->buttonPressed(j);
    }
}

void InputHandler::buttonReleased(JoystickButtonEvent j) {
    std::list<JoystickListener*>::iterator it;
    for (it=JoystickListeners.begin();it!=JoystickListeners.end();it++) {
        (*it)->buttonReleased(j);
    }
}

void InputHandler::axisEvent(JoystickAxisEvent j) {
    std::list<JoystickListener*>::iterator it;
    for (it=JoystickListeners.begin();it!=JoystickListeners.end();it++) {
        (*it)->axisEvent(j);
    }
}

void InputHandler::mouseMoved(MouseMotionEvent e) {
    std::list<MouseListener*>::iterator it;
    for (it=MouseListeners.begin();it!=MouseListeners.end();it++) {
        (*it)->mouseMoved(e);
    }
}

void InputHandler::mouseButtonPressed(MouseButtonEvent e) {
    std::list<MouseListener*>::iterator it;
    for (it=MouseListeners.begin();it!=MouseListeners.end();it++) {
        (*it)->mouseButtonPressed(e);
    }
}

void InputHandler::mouseButtonReleased(MouseButtonEvent e) {
    std::list<MouseListener*>::iterator it;
    for (it=MouseListeners.begin();it!=MouseListeners.end();it++) {
        (*it)->mouseButtonReleased(e);
    }
}



