package net.northking.cctp.upperComputer.constants;

import net.northking.cctp.upperComputer.driver.agent.command.KeyEventCommand;

public enum AndroidHotKeyCodeEnum {

    HOME("home", KeyEventCommand.KEYCODE_HOME),
    MENU("menu",KeyEventCommand.KEYCODE_MENU),
    BACK("back",KeyEventCommand.KEYCODE_BACK),
    APP_SWITCH("appSwitch",KeyEventCommand.KEYCODE_APP_SWITCH),
    VOLUME_UP("volumeUp",KeyEventCommand.KEYCODE_VOLUME_UP),
    VOLUME_DOWN("volumeDown",KeyEventCommand.KEYCODE_VOLUME_DOWN),
    POWER("power", KeyEventCommand.KEYCODE_POWER),
    SWITCH_CHARSET("switchCharset",KeyEventCommand.KEYCODE_SWITCH_CHARSET);

    private String webValue;

    private int code;

    AndroidHotKeyCodeEnum(String webValue, int code){
        this.webValue = webValue;
        this.code = code;
    }

    public static int getCode(String webValue){
        for (AndroidHotKeyCodeEnum value : AndroidHotKeyCodeEnum.values()) {
            if (value.webValue.equals(webValue)) {
                return value.code;
            }
        }
        return -1;
    }


}
