mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 04:15:14 -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() {
|
override fun draw() {
|
||||||
renderWindow.renderSystem.framebuffer = null
|
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()
|
framebuffer.bindTexture()
|
||||||
shader.use()
|
shader.use()
|
||||||
mesh.draw()
|
mesh.draw()
|
||||||
|
@ -55,7 +55,21 @@ class RenderWindowInputHandler(
|
|||||||
var inputHandler: InputHandler? = null
|
var inputHandler: InputHandler? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
field = 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) {
|
renderWindow.window.cursorMode = if (value == null) {
|
||||||
CursorModes.DISABLED
|
CursorModes.DISABLED
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user