Commit graph

342 commits

Author SHA1 Message Date
Sean Cross 8b9445eea4
key_handler: add a callback for key events (#243)
* key_handler: add a callback for key events

Add a callback for key events. This includes complete events such as
Shift, not just text events.

A default handler is provided for backwards compatibility.

Signed-off-by: Sean Cross <sean@xobs.io>

* fix: EventQueue::dispatch blocks until some events are available (#265)

use non blocking alternative as documented in EventQueue

Co-authored-by: vemoo <berublan@gmail.com>
2022-01-26 08:23:38 +01:00
KaDiWa 8927b29a69
macOS: Fix segmentation fault when resizing window (#269) 2021-12-12 23:06:17 +01:00
vemoo 49aad5c586
Revert bump of xkbcommon-sys (#268)
`xkb` still depends on the previous version
and there are some issues in the new version
https://github.com/meh/rust-xkbcommon-sys/issues/7
2021-12-07 07:24:30 +01:00
vemoo 0f7d175621
address clippy lints (#267) 2021-12-06 16:34:01 +01:00
vemoo a4ba00b209
Bump versions (#266)
* bump wayland deps

* bump xkbcommon-sys

* bump raw-window-handle

* bump png
2021-12-06 14:17:01 +01:00
vemoo e0992261c9
fix: EventQueue::dispatch blocks until some events are available (#265)
use non blocking alternative as documented in EventQueue
2021-12-06 12:11:50 +01:00
Daniel Collin 08dcf752af Correct version 2021-11-28 18:50:09 +01:00
Daniel Collin 7c10c2fa78 Bump to 0.20 2021-11-28 18:49:41 +01:00
Daniel Collin 64f2afde3d Fixed typo 2021-11-28 18:08:38 +01:00
Daniel Collin 883679e96b Fix for stuck scrollwheel on macOS 2021-11-28 18:03:01 +01:00
john01dav 2b2540067c
Support typed keys on x11
* Added not-yet-working draft implementation of proper X11 support for reading correct typed characters

* Made shift work for capital letters with X11, but compose key is still broken

* Compose key and numpad now work correctly in X11

* XIM and XIC are now freed when a window destructor runs

* Ran cargo fmt on x11.rs

* Removed commented-out empty-string

Closes #200
2021-11-15 08:45:44 +01:00
Daniel Collin 05cb97aeb0 Rust fmt 2021-10-23 11:40:04 +02:00
Elijah Hartvigsen deb235507f
Changing return types of get_keys from Option<Vec<Key>> to Vec<Key> (#260)
* KeyHandler: Updated return type to Vec on get_keys

* Window: Updated Window structs get_keys return type across all currently supported OS's

* Updated return type of get_keys of Window, and updated the docs for all related functions

* Docs: Corrected incorrect variable ident in docs post update

* Resolved error resulting from get_keys return type change

* Formatting: Ran cargo fmt

Co-authored-by: Zij-IT <elijah.reed@hartvigsen.xyz>
2021-10-23 11:39:18 +02:00
Thomas L. Martin 67fe3a6f29
Minor update to error.rs (#258)
to fix copy/paste issue
2021-09-13 10:04:28 +02:00
dependabot-preview[bot] 1a12653fc2
Upgrade to GitHub-native Dependabot (#247)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-29 05:00:17 +02:00
swismer 75a25ce898
Fix size calculation of non-decorated windows (#245) (#246) 2021-04-03 08:08:51 +02:00
Daniel Collin 0df7c35058 Wrong version 2021-03-23 07:45:38 +01:00
Daniel Collin 0afa9c13f3 Bump to 0.19.3 2021-03-23 07:43:12 +01:00
Quentin Hibon afa0b2ffe5
Add missing words in description (#242) 2021-03-11 06:56:14 +01:00
Marcel Märtens 3e59f17131
update wayland to 0.28 and small cleanup (#241) 2021-03-10 16:35:03 +01:00
Emilio Moretti 241c01219f
Fix wayland missing cursor. (#238)
This fixes the problem with the window automatically closing itself when
the mouse goes over it.
2021-02-21 07:57:29 +01:00
Sean Cross e5b5cc50d5
windows: use c_void from winapi (#235)
The `SelectObject()` call accepts a `HGDIOBJ` which is typecast to a
`std::os::raw::c_void` when building using libstd, and is its own thing
when building with std disabled:

winapi/0.3.9/src/winapi/lib.rs.html:
    #[cfg(feature = "std")]
    pub use std::os::raw::c_void;
    #[cfg(not(feature = "std"))]
    pub enum c_void {}

This patch uses `HGDIOBJ` as the typecast as necessary.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-10 09:04:47 +01:00
Daniel Collin 655e437346 xkbcommon-sys to 0.7.5 2021-01-26 08:53:49 +01:00
Daniel Collin 3a649361ad Bump to 0.19.2 2021-01-19 20:33:13 +01:00
Daniel Jordan ae5172b8a1
Update xkb_keymap reference (#233)
The xkbcommon_sys crate seems to have been updated today, and now the minifb project won't compile. 

We can fix this by updating XKB_KEYMAP_FORMAT_TEXT_v1 to XKB_KEYMAP_FORMAT_TEXT_V1.
2021-01-09 21:12:23 +01:00
CoffmanLevi b39df21ba8
Made the debug text for Error include any sub-errors (#232) 2020-12-30 08:27:32 +01:00
sinclairzx81 ffa4a55487
Fix: winuser | DestroyWindow (#230)
* winuser | DestroyWindow

* rustfmt pass
2020-12-09 13:18:04 +01:00
Max von Forell c1ff776260
change default pointer visibility to true on wayland (#225) 2020-11-12 11:52:24 +01:00
Santeri Salmijärvi 5e29a18ff4
Windows: Fix mouse positions not honoring MouseMode (#223) 2020-11-05 18:44:41 +01:00
Ondřej Hruška a3852bab8a
Fix Key::RightBracket not working on POSIX (#222)
There was a typo in the mappings, right bracket didn't work.
2020-10-24 06:58:37 +02:00
Rupansh efbe6a1c71
WindowOptions: Support none flag (#219)
* WindowOptions: add none flag

* windows: support none flag

Signed-off-by: rupansh <rupanshsekar@hotmail.com>

* os: implement none flags for other operating systems

redox, posix
not applicable on OSX

* WindowOptions: document none option

Signed-off-by: rupansh-arch <rupanshsekar@hotmail.com>
2020-10-01 13:06:48 +02:00
Daniel Collin a56e79ca50 Bump to 0.19.1 2020-09-22 21:00:36 +02:00
Daniel Collin ee3b185098 Removed dummy logging 2020-09-22 20:59:07 +02:00
Daniel Collin fb7d4b0d08 Fixed typo 2020-09-16 08:49:47 +02:00
Daniel Collin 7e040c240a Bump to 0.19 2020-09-16 08:47:42 +02:00
Daniel Collin 8de1d5718d Rustfmt 2020-09-16 08:40:27 +02:00
Daniel Collin 2646964b9e Add char_callback example 2020-09-16 08:34:02 +02:00
derpeter 65e5be1dcf
change pointer type to plattform specific type as the cast is otherwi… (#212)
* change pointer type to plattform specific type as the cast is otherwise broken on ARM (and maybe other) platform.

* shrink the line changed in previous commit to make linter happy

Co-authored-by: Peter Hasse <peter.hasse@fokus.fraunhofer.de>
2020-09-03 18:16:07 +02:00
phillvancejr 15bce84a4e
Added Topmost (always on top) functionality to Windows (#159)
* Added always on top functionality for Windows

* Added always on top functionality for Windows

* Made topmost method in Window public so that the topmost attribute can be defined either at or after creation time as opposed to just at creation time. This allows the topmost functionality to be toggled during the programs runtime as opposed to only at window creation
2020-08-28 21:14:49 +02:00
Evgeniy Reizner de32daf2c1
Remove xkbcommon-sys from x11 dependencies. (#209) 2020-08-23 14:26:06 +02:00
Evgeniy Reizner 8efa8064c7
Remove the 'cast' dependency. (#208) 2020-08-23 14:22:49 +02:00
Daniel Collin e504f1a3e2 Bump to 0.18 2020-08-14 11:56:29 +02:00
Daniel Collin 55734cc6fb 0.18 and made minifb usage a bit more clear. 2020-08-14 11:56:17 +02:00
Daniel Collin f99ee45552 Test fix for get_keys_released on Wayland 2020-08-13 20:15:16 +02:00
Nelson Chen 291d8a0441
Support topmost functionality in Windows (#201)
Most of this was taken from #159. This does not include the API addition of adding a topmost call on Window.

That should probably be in another PR. And the doc fixes as well.

Used implementation from https://github.com/emoon/rust_minifb/pull/159#discussion_r401374050

Co-authored-by: phillvancejr <phillipvancejr@gmail.com>
Co-authored-by: Daniel Collin <daniel@collin.com>

Co-authored-by: phillvancejr <phillipvancejr@gmail.com>
Co-authored-by: Daniel Collin <daniel@collin.com>
2020-07-27 09:27:13 +02:00
Antonino Siena 49004f4380
Update wayland deps (#199)
Co-authored-by: Antonino Siena <a.siena@gmx.de>
2020-07-09 21:21:16 +02:00
Daniel Collin d33084f860 Updated to 0.17 2020-07-09 13:50:16 +02:00
Daniel Collin f94eef1c7b
Cargo fmt pass (#198) 2020-07-09 11:53:46 +02:00
Daniel Collin cb0ceee910 Use null for PeekMessageW on Windows 2020-07-09 11:48:22 +02:00
LoganDark d0d3ffcf7b
Rename unixes to posix (#197)
* Rename `unix`es to `posix`

* Whoops

* deprecate get_unix_menus in favor of get_posix_menus

* doc fixes
2020-07-09 10:21:18 +02:00