Commit graph

105 commits

Author SHA1 Message Date
Noah
2e2d6f1468
Use typed ioctl calls + other misc changes (#29)
* Use typed ioctl calls

* Make enumerate() return an iterator instead of a vec

* Fix(?) events() behavior

* read() into a buf of mem::MaybeUninit

* Add Device.wait_ready()

* impl AsRawFd for Device

* Add remaining ioctls
2021-02-23 13:31:36 -07:00
Jeff Hiner
73fd0ae421
Round 2 of some refactoring/cleanup (#27)
* Make Key a simple u32 code for future-proofing
* Move MAX for bitflags into associated constants; fix Display, tweak compensation logic
* derive Debug for Device, move constants into constants.rs
* Add docstrings and seatbelts to eviocgbit and eviocgabs
* Increase formality per #243
* Make Device optional fields Option, address unclear naming
2021-02-23 11:28:20 -07:00
Jeff Hiner
36bb8faef0 Renamed key_bits to supported_keys, fixed &mut &mut [32] regression 2021-02-22 13:43:58 -07:00
Jeff Hiner
2373a4e262 Formatting 2021-02-22 13:43:41 -07:00
Jeff Hiner
de2c4e026d
Fix a bunch of unsoundness, and clean up some stuff (#26)
* Fix warnings and remove unsafe code
* Eliminate duplicate structs already in libc; fix incorrect eviocgbit lengths, remove transmute
* Avoid hiding unsafe behind macros; use File rather than libc::open
* Change signatures of eviocgbit and eviocgabs to take slices; use align_to_mut to more safely cast slices
* Replace do_ioctl_buf! with wrapper fn
* Add a sanity check for align_to_mut
* Fix incorrect slice casts, add debug asserts for sanity
* Bump revision
2021-02-22 10:57:25 -07:00
Jeff Hiner
4e700d4671
Edition 2018 (#25)
* Edition 2018
* cargo fmt
* Bump rev to 0.11.0-alpha-2
* Change FF_MAX and KEY_MAX to associated constants
2021-02-20 19:26:34 -07:00
Jeff Hiner
fe3d0e9ab0
Update dependencies and fix cross-compatibility issues (#24)
* Update dependencies and fix some cross-compatibility issues
* version 0.11.0-alpha.1
2021-02-20 19:09:39 -07:00
ember arlynx
e55142087e
Merge pull request #23 from AnyTimeTraveler/master
Fix mismatched types when compiling for arm
2021-02-08 13:03:16 -08:00
Simon Struck
f8c06ece87
Fix mismatched types when compiling for arm 2021-02-08 20:39:43 +01:00
ember arlynx
d4cb5004a9
Merge pull request #21 from LinusCDE/master
Force to request absinfo also onmultitouch axes
2020-12-25 12:46:44 -08:00
Linus
43fb0b3399 Force to request absinfo also onmultitouch axes
The dev before me left a comment on handling that
later. Not sure if there is any special case that
needed to be implemented which I now completly
ignored.
2020-11-04 22:23:08 +01:00
ember arlynx
62bb393491
Merge pull request #8 from myfreeweb/master
Adds some bugs!
2020-05-03 22:34:15 -07:00
Corey Richardson
f85abbf1df
Merge pull request #15 from nowakf/relativeaxis
Missing constants for relative axes
2019-07-01 00:24:57 -07:00
Francis Nicholson
4fbd562393 Missing constants for relative axes
I added some of the missing event codes from input-event-codes.h.  Their
omission causes the library to panic with some input devices.
2019-06-30 13:05:59 +02:00
Greg V
13c09cf350 Fix warnings 2017-12-01 23:06:03 +03:00
Greg V
e5e7332952 Update nix to 0.9, support FreeBSD
nix 0.9's ioctl macro works with buffers now.
2017-12-01 22:44:06 +03:00
Corey Richardson
04761b788f
Bump version to 0.10.1 2017-06-17 09:12:13 -04:00
Corey Richardson
b8184e919b Merge pull request #6 from Ralith/fix-abs-sync
Fix sync of absolute axis states
2017-05-30 22:51:08 -04:00
Benjamin Saunders
ca1b1f2342 Fix sync of absolute axis states 2017-05-30 18:33:15 -07:00
Corey Richardson
591d1428c2
Bail out of compensate_dropped if no events were dropped 2017-05-28 17:52:38 -04:00
Corey Richardson
fc27acc715
Remove vestigal debug printlns 2017-05-28 17:52:20 -04:00
Corey Richardson
c6076443aa
Fix tv_usec calculation 2017-05-28 17:49:36 -04:00
Corey Richardson
d9c9225fa0
Don't die if there is no phys name either 2017-05-28 17:28:28 -04:00
Corey Richardson
53b4a6d65e
Don't die if there is no unique name 2017-05-28 17:25:54 -04:00
Corey Richardson
3e15ed1f1d
Remove bogus Fd struct that wasn't ever useful 2017-05-28 17:20:12 -04:00
Corey Richardson
9ff9cf4718
Initial port to nix 2017-05-28 16:05:28 -04:00
Corey Richardson
0c166f7726
Use O_CLOEXEC instead of the non-atomic ioctl fioclex 2017-04-27 20:13:32 -04:00
Corey Richardson
60a7523d4b
Fix all the current issues:
Changes in Rust, changes in the evdev ABI, and a bug
2017-04-27 19:42:45 -04:00
Corey Richardson
ee5bab2689 Bump version 2015-07-21 12:06:18 -04:00
Corey Richardson
341be8cbfb Add number method to every bitflag 2015-07-21 12:04:26 -04:00
Corey Richardson
f3918d09a8 Comment about EV_REL 2015-07-21 08:22:12 -04:00
Corey Richardson
74479a89b5 Didn't mean to commit that yet but fix it anyway 2015-07-21 08:14:48 -04:00
Corey Richardson
43e8f958e7 Add GH_TOKEN 2015-07-21 08:07:36 -04:00
Corey Richardson
519a61b937 Fix badge links 2015-07-21 07:39:03 -04:00
Corey Richardson
92ac2d0c6a Note Rust support in README 2015-07-21 05:53:09 -04:00
Corey Richardson
704bc42ca3 Yank stable support :( 2015-07-21 05:47:33 -04:00
Corey Richardson
6ba2f72dbf Fix some casting issues on stable 2015-07-21 05:45:12 -04:00
Corey Richardson
66887f5771 Add scancodes.rs (missing from git-add) 2015-07-21 05:40:27 -04:00
Corey Richardson
9c72b1ca0b Version 0.9.0 2015-07-21 05:39:18 -04:00
Corey Richardson
18a063fb17 Use ioctl from crates.io 2015-07-21 05:38:58 -04:00
Corey Richardson
25959435d3 Travis: use containers 2015-07-21 05:36:51 -04:00
Corey Richardson
c410f1edfb Update README and evtest 2015-07-21 05:33:40 -04:00
Corey Richardson
1ee9a10343 Hide compensate_dropped from public API 2015-07-21 05:26:47 -04:00
Corey Richardson
45a27eeb17 Implement SYN_DROPPED synchronization 2015-07-21 05:19:07 -04:00
Corey Richardson
bbbd03d0de Use a wrapper around ffs instead of ffs directly
Also exposes it to users.
2015-07-21 05:19:07 -04:00
Corey Richardson
660a0d55d1 Add some more crate-level docs 2015-07-21 05:19:07 -04:00
Corey Richardson
8ca586c485 Shuffle around device state into its own type 2015-07-21 05:19:07 -04:00
Corey Richardson
efd8d1d8f0 Reexport enum values 2015-07-21 05:19:07 -04:00
Corey Richardson
554f3446af Lots of documentation! Also nuke the unstable RawEvents 2015-07-21 05:19:07 -04:00
Corey Richardson
d556b9dcab [fix] Do error handling in fill_events and raw_events 2015-07-21 05:19:06 -04:00