mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 11:54:59 -04:00
disable pressed key bindings when setting input handler
This commit is contained in:
parent
03de2b4f95
commit
1f66b80334
@ -48,7 +48,11 @@ interface IntegratedFramebuffer : Drawable {
|
||||
|
||||
override fun draw() {
|
||||
renderWindow.renderSystem.framebuffer = null
|
||||
renderWindow.renderSystem.reset(blending = true, sourceRGB = BlendingFunctions.SOURCE_ALPHA, destinationRGB = BlendingFunctions.ONE_MINUS_SOURCE_ALPHA)
|
||||
renderWindow.renderSystem.reset(
|
||||
blending = true,
|
||||
sourceRGB = BlendingFunctions.SOURCE_ALPHA,
|
||||
destinationRGB = BlendingFunctions.ONE_MINUS_SOURCE_ALPHA,
|
||||
)
|
||||
framebuffer.bindTexture()
|
||||
shader.use()
|
||||
mesh.draw()
|
||||
|
@ -55,7 +55,21 @@ class RenderWindowInputHandler(
|
||||
var inputHandler: InputHandler? = null
|
||||
set(value) {
|
||||
field = value
|
||||
// ToDo: Toggle key bindings (disable)
|
||||
|
||||
keysDown.clear()
|
||||
val toRemove: MutableSet<ResourceLocation> = mutableSetOf()
|
||||
for (name in keyBindingsDown) {
|
||||
val pair = keyBindingCallbacks[name] ?: continue
|
||||
if (pair.keyBinding.action[KeyAction.STICKY] != null) {
|
||||
continue
|
||||
}
|
||||
for (callback in pair.callback) {
|
||||
callback(false)
|
||||
}
|
||||
toRemove += name
|
||||
}
|
||||
keyBindingsDown -= toRemove
|
||||
|
||||
renderWindow.window.cursorMode = if (value == null) {
|
||||
CursorModes.DISABLED
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user