keybinding

ho

hothacho
답변 대기중
30 XP

public static KeyBinding[] keyBindings = new KeyBinding[3];

keyBindings[0] = new KeyBinding("test", Keyboard.KEY_P, "test");
keyBindings[1] = new KeyBinding("test", Keyboard.KEY_P, "test");
keyBindings[2] = new KeyBinding("test", Keyboard.KEY_P, "test");
     
        for (KeyBinding keyBinding : keyBindings) {
            ClientRegistry.registerKeyBinding(keyBinding);
        }

이런식으로 설정 후에 등록까지는 정상작동 합니다

@SubscribeEvent
    public static void onKey(KeyInputEvent event, EntityPlayer player) {
        if (keyBindings[0].isPressed()) {
            System.out.println("Test Message");
            player.addChatMessage(new ChatComponentText("test"));

그런데 핫키를 눌렀을 때를 인식하지 못합니다


불러오는 중...