What's new
API: Input device simulation and handling
New functions were added to the computer namespace to update the mouse position, confine the mouse cursor within the window, and simulate keyboard events. These functions work on Windows and macOS, but only work under the X windowing system on Linux (or FreeBSD). On Wayland, these functions will throw NE_CO_UNLTOSC, NE_CO_UNLTOMG, or NE_CO_UNLTOSK error messages.
- Implement
computer.setMousePosition(x, y)to update the current mouse cursor position. - Implement
computer.setMouseGrabbing(grabbing; boolean)to activate/deactivate confining the mouse cursor within the native app window. Ifgrabbingis set totrue, the mouse cursor always stays within the window boundaries, so this feature helps create interactive games and similar apps operated using the mouse. - Implement
computer.sendKey(keyCode, keyState)to simulate keyboard events. App developers can use a platform-specific key code and states (press,down, andup) to simulate from simple single key strokes to complex key combinations:
// Simulate letter 'a' press on GNU/Linux:
await Neutralino.computer.sendKey(38)
// Simulate Ctrl + V keyboard shortcut on GNU/Linux:
await Neutralino.computer.sendKey(105, 'down') // Hold right control
await Neutralino.computer.sendKey(47, 'down') // Hold letter 'v'
await Neutralino.computer.sendKey(47, 'up') // Release letter 'v'
await Neutralino.computer.sendKey(105, 'up') // Release right controlAPI: os
- Add
useTemplateIcon: booloption toos.setTray(options)for activating adaptive tray icon with the current color-scheme on macOS.
Improvements/bugfixes
- Display the app icon properly with the
os.showNotification()function when the app is launched from a Mac app bundle. - Fix the window-ordering issue with
window.focus()on macOS. - Auto-focus the app window when the Mac dock app icon is clicked.
- Write full C++ exception messages to the terminal to improve the framework-related bug-reporting experience.
Update the config file option cli.binaryVersion with 6.6.0 and enter neu update to fetch this version.
Get started: https://neutralino.js.org/docs
This release was auto-generated by ReleaseZri 🚀