Releases: pongasoft/emscripten-glfw
Releases · pongasoft/emscripten-glfw
Version 3.4.0.20241004
- Implemented custom cursors (
glfwCreateCursor
)- uses a canvas to draw the cursor image into it and convert it into a URL (
canvas.toDataURL()
) - uses the CSS property syntax:
cursor: url(xxx) xhot yhot, auto
when callingglfwSetCursor
with a custom cursor
- uses a canvas to draw the cursor image into it and convert it into a URL (
Version 3.4.0.20240907
- Fixed Meta/Super key workaround to also handle the rare (but possible) use-case of having other keys down before
pressing the Meta/Super key
Version 3.4.0.20240817
- Major clipboard changes: the clipboard now uses the browser events to handle cut, copy and paste
- Added a way to tweak the timeouts for the Super + Key workaround (Super is also known as Meta or Cmd)
- Added a way to set which keys are allowed to be handled by the browser
- Added a convenient API to open a URL (
emscripten::glfw3::OpenURL
) - Added a convenient API to detect if the runtime platform is Apple (
emscripten::glfw3::IsRuntimePlatformApple
),
mostly used for keyboard shortcuts (Ctrl vs. Cmd). - Added
GLFW/emscripten_glfw3_version.h
withEMSCRIPTEN_GLFW_VERSION
define for compilation time version detection EMSCRIPTEN_USE_PORT_CONTRIB_GLFW3
port define now also contains the version
Warning
Breaking changes!
The clipboard async API has been removed. Check the Clipboard support section for details on how to deal with the clipboard in your application.
Version 3.4.0.20240804
- Fixed
nullptr
issue when clipboard is emtpy - Fixed the internal clipboard being wiped on asynchronous callback error
Version 3.4.0.20240731
- Added
emscripten_glfw_get_clipboard_string
the C version ofemscripten::glfw3::GetClipboardString
to
retrieve the clipboard asynchronously - Added a helper class
emscripten::glfw3::FutureClipboardString
to greatly simplify the more frequent use-cases GetClipboardString::value()
now returns the internal clipboard in case of error, instead of throwing exception- Added
optimizationLevel
option to the emscripten port
Version 3.4.0.20240727
- Introduced C++ API (namespace
emscripten::glfw3
) included withGLFW3/emscripten_glfw3.h
:- provides a more correct API with sensible defaults (ex:
std::string_view
/std::optional<std::string_view>
vschar const *
which may or may not benullptr
) - allow for C++ only API (ex:
std::future
) - the C API is still available if you would rather stick to it
- provides a more correct API with sensible defaults (ex:
- Implemented
emscripten::glfw3::GetClipboardString
(C++ only) which provides a way of fetching the global
clipboard in a browser environment (glfwGetClipboardString
is not the right API due to the asynchronous nature
of the underlying platform API). - The cursor position is no longer clamped to the window size, and as a result, can have negative values or values
greater than the window size.
Note that GLFW implements a similar behavior on the macOS desktop platform. - Implemented
glfwSetWindowPosCallback
- Added support for GLFW Window Attribute
GLFW_HOVERED
- Fixed #6:
emscripten_glfw_make_canvas_resizable
does not clean up properly. - Fixed an issue with opacity: when using opacity, the handle is not working unless its z-index is higher than the
canvas z-index
Version 3.4.0.20240627
- Fixed internal implementation to use
EM_BOOL
(PR #5)
Version 3.4.0.20240625
- Implemented workaround for #4: Using Super + "Key" on macOS results in "Key" not being released.
Due to the broken state of javascript handling theSuper/Meta
key, there is no good solution. The workaround implemented, releases all keys whenSuper
is released. Although not a perfect solution, it guarantees that the state is eventually consistent:- if "Key" was released while "Super" was held, then when "Super" gets released, "Key" is released (later than when actually released, final state is consistent: "Key" in
Release
state) - if "Key" is still held when "Super" is released, "Key" is released when "Super" gets released, but immediately gets a down event (Up/Down event, final state is consistent": "Key" in
Pressed
state)
- if "Key" was released while "Super" was held, then when "Super" gets released, "Key" is released (later than when actually released, final state is consistent: "Key" in
Version 3.4.0.20240617
- Fixed #3: glfwGetKey must return one of
GLFW_PRESS
orGLFW_RELEASE
Version 3.4.0.20240616
- Implemented
glfwGetClipboardString
. Note that due to the async (and restrictive) nature of the
navigator.clipboard.readText
call, this synchronous API returns whatever was set via a previous call
toglfwSetClipboardString
and ignores the external clipboard entirely.