#include "KeyboardEvent.h"

using namespace Framework;

bool Framework::_ret1TE(void* param, void* obj, KeyboardEvent te)
{
    return 1;
}

bool Framework::_onlyNumbersTE(void* param, void* obj, KeyboardEvent te)
{
    if (te.key[0] >= '0' && te.key[0] <= '9') return 1;
    if (te.virtualKey == T_Entf || te.virtualKey == T_BackSpace) return 1;
    if (te.virtualKey == T_Links || te.virtualKey == T_Rechts
        || te.virtualKey == T_Unten || te.virtualKey == T_Oben)
        return 1;
    return 0;
}

bool Framework::_onlyHexTE(void* param, void* obj, KeyboardEvent te)
{
    if (te.key[0] >= '0' && te.key[0] <= '9') return 1;
    if (te.key[0] >= 'A' && te.key[0] <= 'F') return 1;
    if (te.key[0] >= 'a' && te.key[0] <= 'f') return 1;
    if (te.virtualKey == T_Entf || te.virtualKey == T_BackSpace) return 1;
    if (te.virtualKey == T_Links || te.virtualKey == T_Rechts
        || te.virtualKey == T_Unten || te.virtualKey == T_Oben)
        return 1;
    return 0;
}