Commit graph

161 commits

Author SHA1 Message Date
daxpedda
4652d48105
Don't unnecessarily clone canvas on Web (#2934) 2023-07-08 17:05:05 +02:00
dAxpeDDa
b0106898f7 Don't allow event loops to run in parallel 2023-06-29 15:53:58 +02:00
Fredrik Fornwall
924f3323b5 On Web, map bfcache load/unload to suspend/resume 2023-06-28 15:38:49 +02:00
Josh Groves
bc216b8f67
Allow recreating wasm event loop with spawn (#2897) 2023-06-23 19:31:42 +02:00
Josh Groves
864a1d5924
Fix some typos (#2901) 2023-06-23 10:10:36 +03:00
Kirill Chibisov
05444628e6
Provide a way to set cursor area for IME cursor
Rename `Window::set_ime_position` to `Window::set_ime_cursor_area`
adding a way to create cursor exclusive zone.

Fixes #2886.
2023-06-22 19:12:14 +00:00
bbb651
4748890935
Add MouseButton::{Back, Forward} to MouseInput
Add named variants for physical back and forward keys which could
be found on some mice. The macOS bits may not work on all the
hardware given that apple doesn't directly support such a thing.

Co-authored-by: daxpedda <daxpedda@gmail.com>
2023-06-16 08:51:09 +00:00
daxpedda
6300cf915e
On Web, implement DeviceEvents (#2871) 2023-06-14 10:26:26 +02:00
daxpedda
9a9c9b15ba
Implement ResizeObserver (#2859)
Co-authored-by: Liam Murphy <43807659+Liamolucko@users.noreply.github.com>
2023-06-14 09:43:53 +02:00
dAxpeDDa
7ce86c3d2a Use Window.requestIdleCallback() 2023-06-14 00:03:23 +02:00
daxpedda
a444637b18 Revert "Send modifiers first"
This reverts commit e17977d7c7.
2023-06-14 00:01:37 +02:00
daxpedda
f0d88c52a3
Fix pointer deltas on Firefox and send coalesced events together (#2878) 2023-06-13 15:49:27 +02:00
dAxpeDDa
e17977d7c7 Send modifiers first 2023-06-13 14:33:08 +02:00
dAxpeDDa
a7a8ff0bbb Drop pointerrawupdate support 2023-06-13 10:23:48 +02:00
dAxpeDDa
fc046add78 Resume propagation of events 2023-06-12 00:48:14 +02:00
dAxpeDDa
ab4a4a89e6 Remove unused EventListenerOptions 2023-06-11 19:44:52 +02:00
dAxpeDDa
f7a400ddf6 Improve media queries take 2 2023-06-09 20:38:54 +02:00
dAxpeDDa
b5785ba785 Revert "Fix Window::set_inner_size()"
This reverts commit e220a75556.
2023-06-08 09:09:46 +02:00
dAxpeDDa
9797ed86f0 Fix unable to ignore scale factor resize suggestion 2023-06-07 22:46:14 +02:00
dAxpeDDa
e220a75556 Fix Window::set_inner_size() 2023-06-07 14:53:59 +02:00
dAxpeDDa
ab46aa5b79 Replace beforeunload with pagehide 2023-06-05 16:40:53 +02:00
dAxpeDDa
12fb37d827 Make media queries more robust 2023-06-05 16:11:22 +02:00
dAxpeDDa
c88a4ab221 Use correct canvas size for scale factor change 2023-06-05 15:39:17 +02:00
daxpedda
8f7f3efc0d
On Web, implement Send and Sync where appropriate (#2834) 2023-06-05 02:44:54 +02:00
dAxpeDDa
3f4f580181 Add pointerrawupdate support 2023-06-05 02:04:37 +02:00
dAxpeDDa
d3aeff8838 Remove unnecessary preventDefault() calls 2023-06-05 02:04:37 +02:00
dAxpeDDa
0786d534f4 Take IntoIterator in send_events() 2023-06-05 02:04:37 +02:00
dAxpeDDa
b4b2389d0a Split modifier handling in all pointer events 2023-06-05 02:04:37 +02:00
dAxpeDDa
964e342f69 Prevent text selection 2023-06-05 02:04:37 +02:00
dAxpeDDa
a134a59917 Remove MouseEvent fallback support 2023-06-05 02:04:37 +02:00
dAxpeDDa
fbba203c4a Focus window on touch press 2023-06-05 02:04:37 +02:00
dAxpeDDa
61bd8b8254 Send position on button release 2023-06-05 02:04:37 +02:00
dAxpeDDa
587fa67571 Split cursor move handlers 2023-06-05 02:04:37 +02:00
dAxpeDDa
82d0380ea6 Ignore pen input on Web 2023-06-04 00:23:47 +02:00
dAxpeDDa
5bbe87960e Replace instant with web-time 2023-06-03 16:05:44 +02:00
dAxpeDDa
4f3eacf01e On Web, handle coalesced events 2023-06-02 18:48:34 +02:00
George Burton
31ebc5caf4
Update bitflags to 2.0
Co-authored-by: dAxpeDDa <daxpedda@gmail.com>
2023-06-02 17:44:36 +03:00
dAxpeDDa
d273518ce9 Process pointer button events 2023-06-02 12:41:35 +02:00
dAxpeDDa
ba5ad3be13 On Web, fix no-op for Window::set_fullscreen 2023-05-31 15:25:15 +02:00
Simon Hausmann
de5327477a web: Fix position of touch events to be relative to the canvas
Use the same logic as for mouse events when not captured.
2023-05-30 21:21:41 +02:00
dAxpeDDa
1805124c54 On Web, wake event loop on request_redraw() 2023-05-28 23:22:08 +02:00
dAxpeDDa
0f64589dba Don't change the internal canvas size 2023-05-28 23:10:33 +02:00
Markus Røyset
918430979f
Overhaul the Keyboard API
Overhaul the keyboard API in winit to mimic the W3C specification
to achieve better crossplatform parity. The `KeyboardInput` event
is now uses `KeyEvent` which consists of:

  - `physical_key` - a cross platform way to refer to scancodes;
  - `logical_key`  - keysym value, which shows your key respecting the
                     layout;
  - `text`         - the text produced by this keypress;
  - `location`     - the location of the key on the keyboard;
  - `repeat`       - whether the key was produced by the repeat.

And also a `platform_specific` field which encapsulates extra
information on desktop platforms, like key without modifiers
and text with all modifiers.

The `Modifiers` were also slightly reworked as in, the information
whether the left or right modifier is pressed is now also exposed
on platforms where it could be queried reliably. The support was
also added for the web and orbital platforms finishing the API
change.

This change made the `OptionAsAlt` API on macOS redundant thus it
was removed all together.

Co-authored-by: Artúr Kovács <kovacs.artur.barnabas@gmail.com>
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
Co-authored-by: daxpedda <daxpedda@gmail.com>
Fixes: #2631.
Fixes: #2055.
Fixes: #2032.
Fixes: #1904.
Fixes: #1810.
Fixes: #1700.
Fixes: #1443.
Fixes: #1343.
Fixes: #1208.
Fixes: #1151.
Fixes: #812.
Fixes: #600.
Fixes: #361.
Fixes: #343.
2023-05-28 21:02:59 +03:00
Kirill Chibisov
bd9cc2a9da
Use cursor-icon crate for CursorIcon
This crate is aimed to simplify handling of cursor icon across
various crates and be used in the public API.
2023-05-09 20:19:35 +03:00
Simon Hausmann
a31f71ee07
Add support for Window::theme on the web (#2687) 2023-02-20 08:51:21 +01:00
Lukas Lihotzki
1b4045dcb2
Add Window::set_ime_purpose
This adds a way to set the purpose for the IME input, implemented
only on Wayland for now.
2023-01-29 18:46:46 +03:00
Kirill Chibisov
930df0ec45
Fix clippy issues on stable 2023-01-27 07:18:58 +03:00
Douglas Dwyer
b711a11549
Properly remove window mouse event listeners (#2632)
* Properly remove window mouse event listeners

* Update CHANGELOG.md

* Fix formatting

Co-authored-by: Mads Marquart <mads@marquart.dk>
2023-01-21 16:58:05 +01:00
Amr Bashir
809162fbd0
Add Window::is_minimized
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
Co-authored-by: Markus Siglreithmaier <m.siglreith@gmail.com>
2023-01-20 00:39:04 +03:00
Amr Bashir
a88d2e079d
On Windows and MacOS, add Window::has_focus 2023-01-17 04:30:14 +03:00