|
1 | 1 | package uno.glfw |
2 | 2 |
|
3 | | -import glm_.BYTES |
4 | 3 | import glm_.bool |
5 | 4 | import glm_.f |
6 | 5 | import glm_.i |
@@ -420,7 +419,7 @@ open class GlfwWindow(var handle: GlfwWindowHandle) { |
420 | 419 | val defaultKeyCallback: KeyCallbackT = { key, scanCode, action, mods -> onKey(Key of key, scanCode, action, mods) } |
421 | 420 | val defaultMouseButtonCallback: MouseButtonCallbackT = { button, action, mods -> onMouse(MouseButton of button, action, mods) } |
422 | 421 | val defaultCursorPosCallback: CursorPosCallbackT = { pos -> onMouseMoved(pos) } |
423 | | - val defaultCursorEnterCallback: CursorEnterCallbackT = { entered -> if(entered) onMouseEntered() else onMouseExited() } |
| 422 | + val defaultCursorEnterCallback: CursorEnterCallbackT = { entered -> if (entered) onMouseEntered() else onMouseExited() } |
424 | 423 | val defaultScrollCallback: ScrollCallbackT = { scroll -> onMouseScrolled(scroll.y.f) } |
425 | 424 | val defaultWindowCloseCallback: WindowCloseCallbackT = ::onWindowClosed |
426 | 425 | val defaultWindowContentScaleCallback: WindowContentScaleCallbackT = { newScale -> onWindowContentScaled(newScale) } |
@@ -479,11 +478,11 @@ open class GlfwWindow(var handle: GlfwWindowHandle) { |
479 | 478 |
|
480 | 479 | enum class CursorStatus { Normal, Hidden, Disabled } |
481 | 480 |
|
482 | | - fun isPressed(key: Key) = glfwGetKey(handle.L, key.i) == GLFW_PRESS |
483 | | - fun isReleased(key: Key) = glfwGetKey(handle.L, key.i) == GLFW_RELEASE |
| 481 | + infix fun isPressed(key: Key): Boolean = glfwGetKey(handle.L, key.i) == GLFW_PRESS |
| 482 | + infix fun isReleased(key: Key): Boolean = glfwGetKey(handle.L, key.i) == GLFW_RELEASE |
484 | 483 |
|
485 | | - fun isPressed(button: MouseButton) = glfwGetMouseButton(handle.L, button.i) == GLFW_PRESS |
486 | | - fun isRelease(button: MouseButton) = glfwGetMouseButton(handle.L, button.i) == GLFW_RELEASE |
| 484 | + infix fun isPressed(button: MouseButton): Boolean = glfwGetMouseButton(handle.L, button.i) == GLFW_PRESS |
| 485 | + infix fun isRelease(button: MouseButton): Boolean = glfwGetMouseButton(handle.L, button.i) == GLFW_RELEASE |
487 | 486 |
|
488 | 487 | val joystick1Buttons: ByteBuffer? |
489 | 488 | get() = getJoystickButtons(GLFW_JOYSTICK_1) |
|
0 commit comments