Narsil / rdev

Simple library to listen and send events to keyboard and mouse (MacOS, Windows, Linux)
MIT License
503 stars 124 forks source link

cargo-release changes and migrate to windows-sys #97

Closed sn99 closed 1 year ago

sn99 commented 1 year ago

Changes include migrating to windows-sys and cargo release optimizations

Narsil commented 1 year ago

No.

(You didn't argument for this change, so I won't argument in my refusal)

sn99 commented 1 year ago

@Narsil My bad, the changes include:

Narsil commented 1 year ago

I'll reopen, since it does seem winapi is not well maintained.

sn99 commented 1 year ago

I am on a windows system and the last test seems to fail even on my machine, even before I made any changes:

PS C:\Users\sn99\Downloads\rdev-main\rdev-main> cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.06s
     Running unittests src\lib.rs (target\debug\deps\rdev-c607d680501d202a.exe)

running 2 tests
test tests::test_keyboard_state ... ok
test windows::keycodes::test::test_reversible ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests\listen_and_simulate.rs (target\debug\deps\listen_and_simulate-7e3563f7acb512d4.exe)

running 1 test
test test_listen_and_simulate ... FAILED

failures:

---- test_listen_and_simulate stdout ----
thread 'test_listen_and_simulate' panicked at 'assertion failed: `(left == right)`
  left: `MouseMove { x: 0.0, y: 1.0 }`,
 right: `MouseMove { x: 0.0, y: 0.0 }`', tests\listen_and_simulate.rs:39:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    test_listen_and_simulate

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.10s

error: test failed, to rerun pass `--test listen_and_simulate`
sn99 commented 1 year ago

I think the suggested changes are pretty good, I will look into them again tomorrow, windows-rs has 2 parts windows and windows-sys, the differences are mentioned here https://kennykerr.ca/rust-getting-started/windows-or-windows-sys.html, do you want me to choose windows rather than windows-sys?

Narsil commented 1 year ago

I think the suggested changes are pretty good, I will look into them again tomorrow, windows-rs has 2 parts windows and windows-sys, the differences are mentioned here https://kennykerr.ca/rust-getting-started/windows-or-windows-sys.html, do you want me to choose windows rather than windows-sys?

I think as a starter let's keep to windows-sys. It's closer to what is already there so it will be easier to spot the core differences.

sn99 commented 1 year ago

I will make separate pulls