Skip to content

Commit 8bc3fba

Browse files
committed
Fix not being able to close GUI with hotkey
1 parent c315812 commit 8bc3fba

File tree

1 file changed

+3
-6
lines changed
  • common/src/main/kotlin/com/lambda/module

1 file changed

+3
-6
lines changed

common/src/main/kotlin/com/lambda/module/Module.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,11 @@ abstract class Module(
112112

113113
init {
114114
listener<KeyPressEvent>(alwaysListen = true) { event ->
115+
if (mc.options.commandKey.isPressed) return@listener
115116
if (keybind == KeyCode.UNBOUND) return@listener
117+
if (event.translated != keybind) return@listener
116118

117-
val screen = mc.currentScreen
118-
if (event.translated == keybind
119-
&& !mc.options.commandKey.isPressed
120-
&& (screen == null
121-
|| screen !is LambdaGui)
122-
) toggle()
119+
if (mc.currentScreen == null || this@Module is ClickGui) toggle()
123120
}
124121

125122
onEnable {

0 commit comments

Comments
 (0)