Skip to content

Commit

Permalink
Revert "한영키의 키 바인딩 설정 처리"
Browse files Browse the repository at this point in the history
This reverts commit d712e7e.
  • Loading branch information
sokcuri committed Jul 18, 2020
1 parent ea02b7c commit 4e4f98a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/main/java/kr/neko/sokcuri/naraechat/NaraeChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static ByteBuffer ioResourceToByteBuffer(String resource, int bufferSize)
}

@SubscribeEvent
public void proxyHangulSpecificKey(GuiScreenEvent.KeyboardKeyPressedEvent.Pre event) {
public void onSpecialKeyPressed(GuiScreenEvent.KeyboardKeyPressedEvent.Pre event) {

int keyCode = event.getKeyCode();
int scanCode = event.getScanCode();
Expand Down Expand Up @@ -167,17 +167,19 @@ public void proxyHangulSpecificKey(GuiScreenEvent.KeyboardKeyPressedEvent.Pre ev
}

event.setCanceled(true);
}

// 키 바인딩 설정창일 때 우측 CONTROL이나 ALT가 단독으로만 동작하게 만들기
if (mc.currentScreen instanceof ControlsScreen) {
ControlsScreen controlsScreen = (ControlsScreen)mc.currentScreen;
if (keyCode == GLFW_KEY_RIGHT_CONTROL || keyCode == GLFW_KEY_RIGHT_ALT) {
controlsScreen.keyPressed(keyCode, scanCode, glfwModifier);
controlsScreen.buttonId = null;
event.setCanceled(true);
return;
int glfwModifier = 0;
if (KeyModifier.getActiveModifier() == KeyModifier.SHIFT) {
glfwModifier = GLFW_MOD_SHIFT;
} else if (KeyModifier.getActiveModifier() == KeyModifier.CONTROL) {
glfwModifier = GLFW_MOD_CONTROL;
} else if (KeyModifier.getActiveModifier() == KeyModifier.ALT) {
glfwModifier = GLFW_MOD_ALT;
}

Minecraft mc = Minecraft.getInstance();
mc.currentScreen.keyPressed(keyCode, scanCode, glfwModifier);
mc.currentScreen.keyReleased(keyCode, scanCode, glfwModifier);
}

KeyModifier modifier = KeyModifier.getActiveModifier();
Expand Down

0 comments on commit 4e4f98a

Please sign in to comment.