Skip to content

Commit

Permalink
update vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamakaky committed May 10, 2024
1 parent 639b4d8 commit 7aca933
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"rust-analyzer.cargo.allFeatures": false
"rust-analyzer.cargo.allFeatures": false,
"editor.formatOnSave": true
}
68 changes: 68 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ nom-supreme = "0.8"
human-panic = "2.0"
virtual-gamepad = { git = "https://github.com/Yamakaky/virtual-gamepad", optional = true }
sdl2 = { version = "0.36", features = ["hidapi"], optional = true }
env_logger = "0.11.3"

[package.metadata.vcpkg]
git = "https://github.com/microsoft/vcpkg"
# Latest master
rev = "cbf4a6641528cee6f172328984576f51698de726"
dependencies = ["sdl2"]
git = "https://github.com/Yamakaky/vcpkg"
branch = "sdl-hidapi"

[package.metadata.vcpkg.target]
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" }
16 changes: 9 additions & 7 deletions mappings/Desktop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@ DOWN = DOWN
# Mouse Buttons and wheel
R = FMOUSE
L = BMOUSE
ZR = LMOUSE LMOUSE
ZL = RMOUSE RMOUSE
ZR = RMOUSE RMOUSE
ZL = LMOUSE LMOUSE

L3 = MMOUSE
LEFT_STICK_MODE = AIM
LLEFT = SCROLLUP
LRIGHT = SCROLLDOWN
SCROLL_SENS = 60

# Button pad is common buttons
S = ENTER
S,S = ESC
W = SPACE
N = BACKSPACE
E = GYRO_OFF
E = ENTER
E,E = ESC
W = !LMOUSE
N = SPACE
N,N = BACKSPACE
S = GYRO_OFF

+ = LALT\ !TAB\ # Task view
- = CONTROL\ LWINDOWS\ O\ # On Screen Keyboard
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ pub enum ClickType {
}

fn main() {
env_logger::init();

// https://github.com/rust-cli/human-panic/issues/77
human_panic::setup_panic!(human_panic::Metadata::new(
env!("CARGO_PKG_NAME"),
Expand Down
7 changes: 1 addition & 6 deletions src/mouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@ pub struct Mouse {

impl Mouse {
pub fn new() -> anyhow::Result<Self> {
#[allow(unused_mut)]
let mut enigo = Enigo::new(&enigo::Settings::default())?;
// Lower delay for xdo, see #1
#[cfg(target_os = "linux")]
enigo.set_delay(100);
Ok(Mouse {
enigo,
enigo: Enigo::new(&enigo::Settings::default())?,
error_accumulator: Vector2::zero(),
})
}
Expand Down

0 comments on commit 7aca933

Please sign in to comment.