Commit graph

32 commits

Author SHA1 Message Date
Noa 7186b413f8
Merge pull request #59 from emberian/bitvec-1
Upgrade to bitvec 1.0.0 (-rc1) in prep for 1.0 release in January
2022-01-11 22:57:43 -06:00
Noa a92586ab4c
bitvec 1.0 🎉 2022-01-11 22:56:55 -06:00
Noa 1d020f11b2
Release 0.11.3 2021-12-07 12:56:56 -06:00
Noa 898bb5c27a
Release 0.11.2 2021-12-03 21:52:09 -06:00
Noa 77d7b9f0e7
Upgrade to bitvec 1.0.0-rc1 in prep for 1.0 release in January 2021-12-03 21:50:39 -06:00
Noa 0d88ebe5b9
Upgrade to bitvec 0.22 with const generics 2021-12-01 13:05:59 -06:00
Noa 763ef01101
Release 0.11.1 2021-10-08 15:13:17 -05:00
Jochen Kupperschmidt 436aedc606 Update nix to 0.23 2021-10-07 09:15:19 -06:00
Noah a458675fb8 Update to nix 0.22, remove custom conversion from nix::Error -> io::Error 2021-08-09 15:22:51 -06:00
Jeff Hiner 1898f49b3c Release 0.11.0 2021-04-01 11:08:19 -06:00
Noah fda0701a7c Upgrade nix to 0.20 2021-03-24 13:01:46 -06:00
Jeff Hiner 6c1add8b73
Add support for virtual uinput devices (#37)
* Prototype support for virtual uinput devices

* Tidy uinput a bit

* Have all the evtest examples use the same args/prompt code

* Switch to libc uinput* structs

* Use InputId in uinput, use libc _CNT constants

* Don't use align_to_mut

* Only check /dev/input/eventN files

* Spelling fixup

* Fix compilation error

* Ah, there we go. Much better.

Co-authored-by: Jeff Hiner <jeff-hiner@users.noreply.github.com>
Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-03-19 09:19:51 -06:00
Jeff Hiner 79b6c2b403
Ergonomics (#38)
* Hide sync_* implementations, expose get_* for state

* Add get_abs_state and rustdoc

* Refactor

* Update rustdoc

Co-authored-by: Jeff Hiner <jeff-hiner@users.noreply.github.com>
2021-03-18 14:34:13 -06:00
Noah 3581aa25e0
Syncing impl (#36)
* WIP syncing impl

* Finish up syncing impl

* Reorganize synchronization code + add more docs

* Wrap libc::input_id

* Remove thread::sleep used for testing

* Make EventStream::Item io::Result<InputEvent>

* Add RawDevice::empty_state()

* Update Device rustdoc

* Make raw/sync_stream naming consistent

* Update crate docs

* Fix missing first event of block

* Owned AttributeSet, borrowed AttributeSetRef

* Add some basic syncing tests

* Add some more syncing tests
2021-03-16 20:38:42 -06:00
Jeff Hiner cb2f5ef87a
Separate out sane blocking and async (nonblocking) implementations (#33)
* Default impl should block. Renaming it to avoid API confusion from previous users.

* Can't get rid of libc::read because we have MaybeUninit, but we can clean up the match

* Remove extra include

* Switch everything over to io::Error

* Add initial tokio impl+example

* Move evtest_tokio to normal example

* Add documentation and clarify

* Use a VecDeque (ring buffer) instead of repeatedly popping things off the front of a Vec

* Looks like we are not using thiserror anymore; removing

* Store read buf between calls

* Add nonblocking example with epoll

Co-authored-by: Jeff Hiner <jeff-hiner@users.noreply.github.com>
Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-03-01 10:09:11 -07:00
Noah 3f32c41fc0
Rework the types in constants (#34)
* Replace bitflags with newtypes

* Don't reexport from libc

* Add a wrapper for event_info

* Hide EvdevEnum

* Make the AttributeSet API more setlike

* Move AttributeSet to its own module

* Add some doc, tidy APIs
2021-02-24 18:09:44 -07:00
Noah a55f319854
Switch to bitvec (#30) 2021-02-23 18:02:10 -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 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
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 9ff9cf4718
Initial port to nix 2017-05-28 16:05:28 -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 704bc42ca3 Yank stable support :( 2015-07-21 05:47:33 -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 d72c3bc57e Fix up sync, open, add getters, raw event reading. 2015-07-07 18:31:28 -04:00
Corey Richardson 075d4392f7 [feat] Initial enumeration and querying 2015-05-31 07:41:42 -04:00
Corey Richardson 4978b2a405 Initial commit 2015-05-29 14:57:46 -04:00