diff --git a/Cargo.lock b/Cargo.lock index 034a8b2..35d24ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.16.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -18,25 +18,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "adler32" -version = "1.2.0" +name = "anstream" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] -name = "aho-corasick" -version = "0.7.18" +name = "anstyle-parse" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ - "memchr", + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.43" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" dependencies = [ "backtrace", ] @@ -58,38 +92,27 @@ checksum = "06e97b4e522f9e55523001238ac59d13a8603af57f69980de5d8de4bbbe8ada6" [[package]] name = "arrayvec" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" -version = "1.0.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.61" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.4.4", + "miniz_oxide", "object", "rustc-demangle", ] @@ -102,15 +125,21 @@ checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" -version = "0.22.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5237f00a8c86130a0cc317830e558b966dd7850d48a953d998c813f01a41b527" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", @@ -119,31 +148,38 @@ dependencies = [ ] [[package]] -name = "brownstone" -version = "1.0.1" +name = "block-sys" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b83224877479161e925498306710f448b13a7f6fdcf69022a60dad1fe3d1bd" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ - "arrayvec", + "objc-sys", ] [[package]] -name = "bytemuck" -version = "1.7.2" +name = "block2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72957246c41db82b8ef88a5486143830adeb8227ef9837740bdec67724cf2c5b" +checksum = "e58aa60e59d8dbfcc36138f5f18be5f24394d33b38b24f7fd0b1caa33095f22f" +dependencies = [ + "block-sys", + "objc2", +] [[package]] -name = "byteorder" -version = "1.4.3" +name = "brownstone" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "c5839ee4f953e811bfdcf223f509cb2c6a3e1447959b0bff459405575bc17f22" +dependencies = [ + "arrayvec", +] [[package]] name = "cc" -version = "1.0.69" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cfg-if" @@ -163,46 +199,55 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.0-beta.4" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcd70aa5597dbc42f7217a543f9ef2768b2ef823ba29036072d30e1d88e98406" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ - "atty", - "bitflags", + "clap_builder", "clap_derive", - "indexmap", - "lazy_static", - "os_str_bytes", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", "strsim", - "termcolor", - "textwrap", - "vec_map", ] [[package]] name = "clap_derive" -version = "3.0.0-beta.4" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5bb0d655624a0b8770d1c178fb8ffcb1f91cc722cb08f451e3dc72465421ac" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.61", ] [[package]] -name = "color_quant" -version = "1.1.0" +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "core-foundation" -version = "0.6.4" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -210,50 +255,58 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.6.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" -version = "0.18.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f15b3cb55687886a6b66953123621e5a1529a91a01666d646fb64baa13f900f0" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", + "core-graphics-types", "foreign-types", "libc", ] [[package]] -name = "crc32fast" -version = "1.2.1" +name = "core-graphics-types" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ - "cfg-if", + "bitflags 1.3.2", + "core-foundation", + "libc", ] [[package]] -name = "deflate" -version = "0.8.6" +name = "dlib" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "adler32", - "byteorder", + "libloading", ] +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dualshock" version = "0.1.0" -source = "git+https://github.com/Yamakaky/joy#2691f8c655213672eb385adaae5a073353a0177c" +source = "git+https://github.com/Yamakaky/joy#a9900ccf9a77aa5ca6c8db3283bdc6e9cd2ee31e" dependencies = [ "anyhow", "cgmath", "dualshock-sys", - "enum-map", + "enum-map 2.7.3", "hid-gamepad-sys", "hidapi", ] @@ -261,7 +314,7 @@ dependencies = [ [[package]] name = "dualshock-sys" version = "0.1.0" -source = "git+https://github.com/Yamakaky/joy#2691f8c655213672eb385adaae5a073353a0177c" +source = "git+https://github.com/Yamakaky/joy#a9900ccf9a77aa5ca6c8db3283bdc6e9cd2ee31e" dependencies = [ "bitfield", "cgmath", @@ -272,24 +325,43 @@ dependencies = [ [[package]] name = "enigo" -version = "0.0.14" -source = "git+https://github.com/Yamakaky/enigo?branch=xdo-sys#406296de4bd173393a0ab524f0117ebdf53419e6" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a4655cdcad61e57cf28922aaa3221b06ce29e644422bba506851a03b8817468" dependencies = [ "core-graphics", - "objc", - "unicode-segmentation", - "winapi", - "xdo-sys", + "foreign-types-shared", + "icrate", + "libc", + "log", + "objc2", + "tempfile", + "wayland-client", + "wayland-protocols-misc", + "wayland-protocols-plasma", + "wayland-protocols-wlr", + "windows", + "xkbcommon", + "xkeysym", ] [[package]] name = "enum-map" -version = "0.6.4" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4187999839f4ae8be35cf185d1381aa8dc32d2f5951349cc37ae49ebc4781855" +checksum = "23595c55d463536d70a0cc71a521d4c1040a2e03816e455c38e8bb1f0981de98" dependencies = [ "array-macro", - "enum-map-derive", + "enum-map-derive 0.4.6", +] + +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive 0.17.0", ] [[package]] @@ -300,45 +372,93 @@ checksum = "e5c450cf304c9e18d45db562025a14fb1ca0f5c769b6f609309f81d4c31de455" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.61", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys", ] [[package]] name = "evdev" -version = "0.11.0" -source = "git+https://github.com/Yamakaky/evdev?branch=fixes#247e9cef148dcdb1864dcc9bca40936164dd3995" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab6055a93a963297befb0f4f6e18f314aec9767a4bbe88b151126df2433610a7" dependencies = [ "bitvec", + "cfg-if", "libc", "nix", + "thiserror", ] +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + [[package]] name = "foreign-types" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ + "foreign-types-macros", "foreign-types-shared", ] +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.61", +] + [[package]] name = "foreign-types-shared" -version = "0.1.1" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "funty" -version = "1.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -347,9 +467,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.25.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gyromouse" @@ -359,7 +479,7 @@ dependencies = [ "cgmath", "clap", "enigo", - "enum-map", + "enum-map 2.7.3", "hid-gamepad", "hid-gamepad-types", "human-panic", @@ -372,27 +492,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" -version = "0.3.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hex" @@ -403,12 +511,12 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hid-gamepad" version = "0.1.0" -source = "git+https://github.com/Yamakaky/joy#2691f8c655213672eb385adaae5a073353a0177c" +source = "git+https://github.com/Yamakaky/joy#a9900ccf9a77aa5ca6c8db3283bdc6e9cd2ee31e" dependencies = [ "anyhow", "cgmath", "dualshock", - "enum-map", + "enum-map 0.6.6", "hid-gamepad-sys", "hidapi", "joycon", @@ -418,11 +526,11 @@ dependencies = [ [[package]] name = "hid-gamepad-sys" version = "0.1.0" -source = "git+https://github.com/Yamakaky/joy#2691f8c655213672eb385adaae5a073353a0177c" +source = "git+https://github.com/Yamakaky/joy#a9900ccf9a77aa5ca6c8db3283bdc6e9cd2ee31e" dependencies = [ "anyhow", "cgmath", - "enum-map", + "enum-map 2.7.3", "hid-gamepad-types", "hidapi", ] @@ -430,51 +538,48 @@ dependencies = [ [[package]] name = "hid-gamepad-types" version = "0.1.0" -source = "git+https://github.com/Yamakaky/joy#2691f8c655213672eb385adaae5a073353a0177c" +source = "git+https://github.com/Yamakaky/joy#a9900ccf9a77aa5ca6c8db3283bdc6e9cd2ee31e" dependencies = [ "cgmath", - "enum-map", + "enum-map 2.7.3", ] [[package]] name = "hidapi" -version = "1.2.6" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e07da7e8614133e88b3a93b7352eb3729e3ccd82d5ab661adf23bef1761bf8" +checksum = "798154e4b6570af74899d71155fb0072d5b17e6aa12f39c8ef22c60fb8ec99e7" dependencies = [ "cc", "libc", "pkg-config", + "winapi", ] [[package]] name = "human-panic" -version = "1.0.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f357a500abcbd7c5f967c1d45c8838585b36743823b9d43488f24850534e36" +checksum = "a4c5d0e9120f6bca6120d142c7ede1ba376dd6bf276d69dd3dbe6cbeb7824179" dependencies = [ + "anstream", + "anstyle", "backtrace", - "os_type", + "os_info", "serde", "serde_derive", - "termcolor", "toml", "uuid", ] [[package]] -name = "image" -version = "0.23.14" +name = "icrate" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" +checksum = "3fb69199826926eb864697bddd27f73d9fddcffc004f5733131e15b465e30642" dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "num-iter", - "num-rational 0.3.2", - "num-traits", - "png", + "block2", + "objc2", ] [[package]] @@ -485,14 +590,20 @@ checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" [[package]] name = "indexmap" -version = "1.7.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "joinery" version = "2.1.0" @@ -502,15 +613,14 @@ checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" [[package]] name = "joycon" version = "0.1.0" -source = "git+https://github.com/Yamakaky/joy#2691f8c655213672eb385adaae5a073353a0177c" +source = "git+https://github.com/Yamakaky/joy#a9900ccf9a77aa5ca6c8db3283bdc6e9cd2ee31e" dependencies = [ "anyhow", "cgmath", - "enum-map", + "enum-map 2.7.3", "hex", "hid-gamepad-sys", "hidapi", - "image", "joycon-sys", "tracing", ] @@ -518,7 +628,7 @@ dependencies = [ [[package]] name = "joycon-sys" version = "0.1.0" -source = "git+https://github.com/Yamakaky/joy#2691f8c655213672eb385adaae5a073353a0177c" +source = "git+https://github.com/Yamakaky/joy#a9900ccf9a77aa5ca6c8db3283bdc6e9cd2ee31e" dependencies = [ "bitfield", "cgmath", @@ -535,66 +645,78 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.100" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] -name = "malloc_buf" -version = "0.0.6" +name = "libloading" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ - "libc", + "cfg-if", + "windows-targets", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + [[package]] name = "memchr" -version = "2.4.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] -name = "memoffset" -version = "0.6.4" +name = "memmap2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" dependencies = [ - "autocfg", + "libc", ] [[package]] -name = "minimal-lexical" -version = "0.1.2" +name = "memoffset" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6595bb28ed34f43c3fe088e48f6cfb2e033cab45f25a5384d5fdf564fbc8c4b2" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] [[package]] -name = "miniz_oxide" -version = "0.3.7" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" -dependencies = [ - "adler32", -] +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", - "autocfg", ] [[package]] name = "nix" -version = "0.20.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8e5e343312e7fbeb2a52139114e9e702991ef9c2aea6817ff2440b35647d56" +checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", "cfg-if", "libc", @@ -603,20 +725,19 @@ dependencies = [ [[package]] name = "nom" -version = "7.0.0" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", - "version_check", ] [[package]] name = "nom-supreme" -version = "0.6.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aadc66631948f6b65da03be4c4cd8bd104d481697ecbb9bbd65719b1ec60bc9f" +checksum = "2bd3ae6c901f1959588759ff51c95d24b491ecb9ff91aa9c2ef4acc5b1dcab27" dependencies = [ "brownstone", "indent_write", @@ -627,22 +748,22 @@ dependencies = [ [[package]] name = "num" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ "num-complex", "num-integer", "num-iter", - "num-rational 0.4.0", + "num-rational", "num-traits", ] [[package]] name = "num-complex" -version = "0.4.0" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -655,24 +776,23 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.42" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -681,169 +801,148 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] -name = "num-rational" -version = "0.4.0" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "num-integer", - "num-traits", ] [[package]] -name = "num-traits" -version = "0.2.14" +name = "objc-sys" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] +checksum = "da284c198fb9b7b0603f8635185e85fbd5b64ee154b1ed406d489077de2d6d60" [[package]] -name = "objc" -version = "0.2.7" +name = "objc2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +checksum = "b4b25e1034d0e636cd84707ccdaa9f81243d399196b8a773946dcffec0401659" dependencies = [ - "malloc_buf", + "objc-sys", + "objc2-encode", ] +[[package]] +name = "objc2-encode" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88658da63e4cc2c8adb1262902cd6af51094df0488b760d6fd27194269c0950a" + [[package]] name = "object" -version = "0.26.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2766204889d09937d00bfbb7fec56bb2a199e2ade963cab19185d8a6104c7c" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] -name = "os_str_bytes" -version = "3.1.0" +name = "once_cell" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6acbef58a60fe69ab50510a55bc8cdd4d6cf2283d27ad338f54cb52747a9cf2d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "os_type" -version = "2.3.0" +name = "os_info" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96eaebe22d9f12429b1af6a0b5dd411ccfc5cb5968710abbb8c512046be9df90" +checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" dependencies = [ - "regex", + "log", + "serde", + "windows-sys", ] [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] -name = "png" -version = "0.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" -dependencies = [ - "bitflags", - "crc32fast", - "deflate", - "miniz_oxide 0.3.7", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro2" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "unicode-ident", ] [[package]] -name = "proc-macro2" -version = "1.0.28" +name = "quick-xml" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ - "unicode-xid", + "memchr", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "radium" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] -name = "regex" -version = "1.5.4" +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "regex-syntax" -version = "0.6.25" +name = "rustix" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] [[package]] -name = "rustc-demangle" -version = "0.1.21" +name = "scoped-tls" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "sdl2" -version = "0.34.5" -source = "git+https://github.com/Yamakaky/rust-sdl2?branch=sensor-api#27d164da7693641298db0a80437836e569d585f7" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8356b2697d1ead5a34f40bcc3c5d3620205fe0c7be0a14656223bfeec0258891" dependencies = [ - "bitflags", + "bitflags 1.3.2", "lazy_static", "libc", "sdl2-sys", @@ -851,8 +950,9 @@ dependencies = [ [[package]] name = "sdl2-sys" -version = "0.34.5" -source = "git+https://github.com/Yamakaky/rust-sdl2?branch=sensor-api#27d164da7693641298db0a80437836e569d585f7" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26bcacfdd45d539fb5785049feb0038a63931aa896c7763a2a12e125ec58bd29" dependencies = [ "cfg-if", "libc", @@ -862,98 +962,144 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.129" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f72836d2aa753853178eda473a3b9d8e4eefdaf20523b919677e6de489f8f1" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +dependencies = [ + "serde_derive", +] [[package]] name = "serde_derive" -version = "1.0.129" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57ae87ad533d9a56427558b516d0adac283614e347abf85b0dc0cbbf0a249f3" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.61", +] + +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", ] +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "1.0.75" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "tap" -version = "1.0.1" +name = "syn" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "termcolor" -version = "1.1.2" +name = "tap" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", -] +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] -name = "textwrap" -version = "0.14.2" +name = "tempfile" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "unicode-width", + "cfg-if", + "fastrand", + "rustix", + "windows-sys", ] [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.26" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.61", ] [[package]] name = "toml" -version = "0.5.8" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" dependencies = [ + "indexmap", "serde", + "serde_spanned", + "toml_datetime", ] [[package]] name = "tracing" -version = "0.1.26" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -961,47 +1107,41 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.15" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.61", ] [[package]] name = "tracing-core" -version = "0.1.19" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] -name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - -[[package]] -name = "unicode-width" -version = "0.1.8" +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "utf8parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "0.8.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", ] @@ -1012,29 +1152,17 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version-compare" -version = "0.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" - -[[package]] -name = "version_check" -version = "0.9.3" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" [[package]] name = "vigem-client" -version = "0.1.0" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d624db0255b12f900e92a15dcfd56bad269c5c0924b623101233eb1b9ae5084d" +checksum = "b857e6f99efe1e1eb1e4dfb035de8ae7ec8ec56bd1928edcbd7c6e4427634d52" dependencies = [ "winapi", ] @@ -1042,7 +1170,7 @@ dependencies = [ [[package]] name = "virtual-gamepad" version = "0.1.0" -source = "git+https://github.com/Yamakaky/virtual-gamepad#66dc49ba4c8752335284ad00847a91182471ab9a" +source = "git+https://github.com/Yamakaky/virtual-gamepad#ddc6dae0d6f5c6074c7627f393b259c8606cbaaf" dependencies = [ "anyhow", "evdev", @@ -1051,9 +1179,108 @@ dependencies = [ [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wayland-backend" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" +dependencies = [ + "bitflags 2.5.0", + "rustix", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" +dependencies = [ + "bitflags 2.5.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-misc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5933740b200188c9b4c38601b8212e8c154d7de0d2cb171944e137a77de1e" +dependencies = [ + "bitflags 2.5.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +dependencies = [ + "bitflags 2.5.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.5.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +dependencies = [ + "dlib", + "log", + "pkg-config", +] [[package]] name = "winapi" @@ -1072,33 +1299,159 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] -name = "winapi-util" -version = "0.1.5" +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ - "winapi", + "windows-core", + "windows-targets", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-core" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.61", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.61", +] + +[[package]] +name = "windows-result" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "wyz" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "129e027ad65ce1453680623c3fb5163cbf7107bfe1aa32257e7d0e63f9ced188" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] [[package]] -name = "xdo-sys" -version = "0.1.0" -source = "git+https://github.com/Yamakaky/xdo-sys#350b8e6837578bf9e8aca14dc3837704ec4424a2" +name = "xkbcommon" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13867d259930edc7091a6c41b4ce6eee464328c6ff9659b7e4c668ca20d4c91e" dependencies = [ - "cc", + "libc", + "memmap2", + "xkeysym", ] + +[[package]] +name = "xkeysym" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" diff --git a/Cargo.toml b/Cargo.toml index 03d16ed..8ca43a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,23 +19,17 @@ lto = true [dependencies] anyhow = { version = "1.0", features = ["backtrace"] } cgmath = "0.18" -clap = "3.0.0-beta.2" -enigo = { git = "https://github.com/Yamakaky/enigo", branch = "xdo-sys" } -# see https://gitlab.com/KonradBorowski/enum-map/-/issues/20 -enum-map = "0.6" +clap = { version = "4.0", features = ["cargo", "derive"] } +enigo = { version = "0.2", features = ["wayland"] } +enum-map = "2.0" hid-gamepad-types = { git = "https://github.com/Yamakaky/joy" } hid-gamepad = { git = "https://github.com/Yamakaky/joy", optional = true } joycon = { git = "https://github.com/Yamakaky/joy", optional = true } nom = "7.0.0" -nom-supreme = "0.6.0" -human-panic = "1.0.3" +nom-supreme = "0.8" +human-panic = "2.0" virtual-gamepad = { git = "https://github.com/Yamakaky/virtual-gamepad", optional = true } - -[dependencies.sdl2] -git = "https://github.com/Yamakaky/rust-sdl2" -branch = "sensor-api" -optional = true -default-features = false +sdl2 = { version = "0.36", features = ["hidapi"], optional = true } [package.metadata.vcpkg] dependencies = ["sdl2"] diff --git a/mappings/overwatch b/mappings/overwatch index b351feb..7e0806e 100644 --- a/mappings/overwatch +++ b/mappings/overwatch @@ -9,12 +9,12 @@ ZR = e ZL = SHIFT R = LMOUSE L = RMOUSE -#N = a -#W = r f -#E = none gyro_off -#S = SPACE +N = a +W = r f +E = none gyro_off +S = SPACE -N = X_Y -S = X_A -W = X_X -E = X_B +#N = X_Y +#S = X_A +#W = X_X +#E = X_B diff --git a/src/backend/sdl.rs b/src/backend/sdl.rs index 67df2f4..ea7a023 100644 --- a/src/backend/sdl.rs +++ b/src/backend/sdl.rs @@ -8,12 +8,7 @@ use anyhow::{bail, Result}; use cgmath::{vec2, Vector3}; use hid_gamepad_types::{Acceleration, JoyKey, Motion, RotationSpeed}; use sdl2::{ - self, - controller::{Axis, Button, GameController}, - event::Event, - keyboard::Keycode, - sensor::SensorType, - GameControllerSubsystem, Sdl, + self, controller::{Axis, Button, GameController}, event::Event, keyboard::Keycode, sensor::SensorType, GameControllerSubsystem, Sdl }; use crate::{ @@ -29,7 +24,6 @@ use super::Backend; pub struct SDLBackend { sdl: Sdl, game_controller_system: GameControllerSubsystem, - mouse: Mouse, } impl SDLBackend { @@ -51,7 +45,6 @@ impl SDLBackend { Ok(Self { sdl, game_controller_system, - mouse: Mouse::new(), }) } } @@ -144,7 +137,7 @@ impl Backend for SDLBackend { settings.clone(), bindings.clone(), Calibration::empty(), - self.mouse.clone(), + Mouse::new()?, )?; controllers.insert( controller.instance_id(), @@ -278,5 +271,11 @@ fn sdl_to_sys(button: Button) -> JoyKey { Button::DPadDown => JoyKey::Down, Button::DPadLeft => JoyKey::Left, Button::DPadRight => JoyKey::Right, + Button::Misc1 => todo!(), + Button::Paddle1 => todo!(), + Button::Paddle2 => todo!(), + Button::Paddle3 => todo!(), + Button::Paddle4 => todo!(), + Button::Touchpad => todo!(), } } diff --git a/src/config/parse.rs b/src/config/parse.rs index 5af2fbc..1688230 100644 --- a/src/config/parse.rs +++ b/src/config/parse.rs @@ -464,7 +464,7 @@ fn keyboardkey(input: Input) -> IRes<'_, enigo::Key> { use enigo::Key::*; let char_parse = |input| { satisfy(|c| is_alphanumeric(c as u8))(input) - .map(|(i, x)| (i, Layout(x))) + .map(|(i, x)| (i, Unicode(x))) .map_err(|_: nom::Err>>| { nom::Err::Error(ErrorTree::from_tag(input, "a keyboard letter")) }) @@ -517,8 +517,8 @@ fn keyboardkey(input: Input) -> IRes<'_, enigo::Key> { ))(input) } -fn mousekey(input: Input) -> IRes<'_, enigo::MouseButton> { - use enigo::MouseButton::*; +fn mousekey(input: Input) -> IRes<'_, enigo::Button> { + use enigo::Button::*; let key_parse = |key, tag| value(key, tag_no_case(tag)); alt(( key_parse(Left, "LMouse"), diff --git a/src/config/types.rs b/src/config/types.rs index 91c56a7..d307b65 100644 --- a/src/config/types.rs +++ b/src/config/types.rs @@ -35,7 +35,7 @@ pub struct JSMAction { #[derive(Debug, Copy, Clone)] pub enum ActionType { Key(enigo::Key), - Mouse(enigo::MouseButton), + Mouse(enigo::Button), Special(SpecialKey), #[cfg(feature = "vgamepad")] Gamepad(virtual_gamepad::Key), diff --git a/src/engine.rs b/src/engine.rs index 489dee1..71281cd 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -4,7 +4,7 @@ use std::{ }; use cgmath::Vector2; -use enigo::{KeyboardControllable, MouseControllable}; +use enigo::{Direction, Keyboard as _, Mouse as _}; use hid_gamepad_types::{Acceleration, Motion, RotationSpeed}; use crate::{ @@ -111,16 +111,16 @@ impl Engine { ExtAction::GyroOn(ClickType::Click) | ExtAction::GyroOff(ClickType::Click) => { eprintln!("Warning: event type Click has no effect on gyro on/off"); } - ExtAction::KeyPress(c, ClickType::Click) => self.mouse.enigo().key_click(c), - ExtAction::KeyPress(c, ClickType::Press) => self.mouse.enigo().key_down(c), - ExtAction::KeyPress(c, ClickType::Release) => self.mouse.enigo().key_up(c), + ExtAction::KeyPress(c, ClickType::Click) => self.mouse.enigo().key(c, Direction::Click)?, + ExtAction::KeyPress(c, ClickType::Press) => self.mouse.enigo().key(c, Direction::Press)?, + ExtAction::KeyPress(c, ClickType::Release) => self.mouse.enigo().key(c, Direction::Release)?, ExtAction::KeyPress(_, ClickType::Toggle) => { // TODO: Implement key press toggle eprintln!("Warning: key press toggle is not implemented"); } - ExtAction::MousePress(c, ClickType::Click) => self.mouse.enigo().mouse_click(c), - ExtAction::MousePress(c, ClickType::Press) => self.mouse.enigo().mouse_down(c), - ExtAction::MousePress(c, ClickType::Release) => self.mouse.enigo().mouse_up(c), + ExtAction::MousePress(c, ClickType::Click) => self.mouse.enigo().button(c, Direction::Click)?, + ExtAction::MousePress(c, ClickType::Press) => self.mouse.enigo().button(c, Direction::Press)?, + ExtAction::MousePress(c, ClickType::Release) => self.mouse.enigo().button(c, Direction::Release)?, ExtAction::MousePress(_, ClickType::Toggle) => { // TODO: Implement mouse click toggle eprintln!("Warning: mouse click toggle is not implemented"); diff --git a/src/joystick.rs b/src/joystick.rs index b6ba579..0f77243 100644 --- a/src/joystick.rs +++ b/src/joystick.rs @@ -3,7 +3,7 @@ use std::time::{Duration, Instant}; use cgmath::{vec2, AbsDiffEq, Angle, Deg, ElementWise, InnerSpace, Rad, Vector2, Zero}; -use enigo::MouseControllable; +use enigo::{Axis, Mouse as _}; use crate::{ config::{settings::Settings, types::RingMode}, @@ -392,7 +392,7 @@ impl Stick for ScrollStick { let delta = (angle - *last).normalize_signed() / settings.stick.scroll.sens + *acc; let delta_rounded = delta.round(); *acc = delta - delta_rounded; - mouse.enigo().mouse_scroll_y(delta_rounded as i32); + mouse.enigo().scroll(delta_rounded as i32, Axis::Vertical).unwrap(); *last = angle; } } diff --git a/src/main.rs b/src/main.rs index 7c24948..435eec4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ use std::{fs::File, io::Read}; use anyhow::{bail, Context}; use backend::Backend; -use clap::Clap; +use clap::Parser as _; use nom_supreme::{ error::{BaseErrorKind, ErrorTree}, final_parser::{ExtractContext, Location}, @@ -35,12 +35,10 @@ pub enum ClickType { fn main() { // https://github.com/rust-cli/human-panic/issues/77 - human_panic::setup_panic!(human_panic::Metadata { - version: env!("CARGO_PKG_VERSION").into(), - name: env!("CARGO_PKG_NAME").into(), - authors: env!("CARGO_PKG_AUTHORS").replace(":", ", ").into(), - homepage: env!("CARGO_PKG_REPOSITORY").into(), - }); + human_panic::setup_panic!(human_panic::Metadata::new(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")) + .authors(env!("CARGO_PKG_AUTHORS").replace(":", ", ")) + .homepage(env!("CARGO_PKG_REPOSITORY")) + ); if let Err(e) = do_main() { eprintln!("Error: {:?}", e); diff --git a/src/mapping.rs b/src/mapping.rs index d454049..efcc921 100644 --- a/src/mapping.rs +++ b/src/mapping.rs @@ -1,10 +1,9 @@ -use enigo::{Key, MouseButton}; -use enum_map::{Enum, EnumMap}; +use enigo::{Key, Button}; +use enum_map::{Enum, EnumArray, EnumMap}; use hid_gamepad_types::JoyKey; use std::{ collections::HashMap, - fmt::{Debug, Display}, - mem::MaybeUninit, + fmt::Display, time::Duration, }; use std::{convert::TryInto, time::Instant}; @@ -21,7 +20,7 @@ pub enum Action { pub enum ExtAction { None, KeyPress(Key, ClickType), - MousePress(MouseButton, ClickType), + MousePress(Button, ClickType), #[cfg(feature = "vgamepad")] GamepadKeyPress(virtual_gamepad::Key, ClickType), GyroOn(ClickType), @@ -140,55 +139,39 @@ pub enum MapKey { impl MapKey { pub fn to_layer(self) -> u8 { - >::to_usize(self) + ::into_usize(self) .try_into() .expect("error converting MapKey to u8") } } -const JOYKEY_SIZE: usize = >::POSSIBLE_VALUES; -const VIRTKEY_SIZE: usize = >::POSSIBLE_VALUES; +const JOYKEY_SIZE: usize = ::LENGTH; +const VIRTKEY_SIZE: usize = ::LENGTH; const MAP_KEY_SIZE: usize = JOYKEY_SIZE + VIRTKEY_SIZE; -impl Enum for MapKey { - type Array = [V; MAP_KEY_SIZE]; - - const POSSIBLE_VALUES: usize = MAP_KEY_SIZE; - - fn slice(array: &Self::Array) -> &[V] { - array - } - - fn slice_mut(array: &mut Self::Array) -> &mut [V] { - array - } +impl Enum for MapKey { + const LENGTH: usize = MAP_KEY_SIZE; fn from_usize(value: usize) -> Self { if value < JOYKEY_SIZE { - >::from_usize(value).into() + ::from_usize(value).into() } else if value < MAP_KEY_SIZE { - >::from_usize(value - JOYKEY_SIZE).into() + ::from_usize(value - JOYKEY_SIZE).into() } else { unreachable!("MapKey value cannot be > MAP_KEY_SIZE"); } } - fn to_usize(self) -> usize { + fn into_usize(self) -> usize { match self { - MapKey::Physical(p) => >::to_usize(p), - MapKey::Virtual(v) => >::to_usize(v) + JOYKEY_SIZE, + MapKey::Physical(p) => ::into_usize(p), + MapKey::Virtual(v) => ::into_usize(v) + JOYKEY_SIZE, } } +} - fn from_function V>(mut f: F) -> Self::Array { - unsafe { - let mut out = MaybeUninit::<[MaybeUninit; MAP_KEY_SIZE]>::uninit().assume_init(); - for (i, out) in out.iter_mut().enumerate() { - *out = MaybeUninit::new(f(>::from_usize(i))); - } - out.as_ptr().cast::().read() - } - } +impl EnumArray for MapKey{ + type Array = [T; MAP_KEY_SIZE]; } impl From for MapKey { @@ -218,8 +201,8 @@ pub struct Buttons { impl Buttons { pub fn new() -> Self { Buttons { - bindings: EnumMap::new(), - state: EnumMap::new(), + bindings: EnumMap::default(), + state: EnumMap::default(), current_layers: vec![0], ext_actions: Vec::new(), hold_delay: Duration::from_millis(100), @@ -236,8 +219,8 @@ impl Buttons { } pub fn tick(&mut self, now: Instant) -> impl Iterator + '_ { - for key in (0..>::POSSIBLE_VALUES) - .map(>::from_usize) + for key in (0..::LENGTH) + .map(::from_usize) { let binding = self.find_binding(key); match self.state[key].status { diff --git a/src/mouse.rs b/src/mouse.rs index 4a28897..4881ea7 100644 --- a/src/mouse.rs +++ b/src/mouse.rs @@ -1,7 +1,7 @@ use std::ops::AddAssign; use cgmath::{vec2, Deg, Vector2, Zero}; -use enigo::{Enigo, MouseControllable}; +use enigo::{Coordinate, Enigo, Mouse as _}; use crate::config::settings::MouseSettings; @@ -42,23 +42,18 @@ pub struct Mouse { error_accumulator: Vector2, } -impl Clone for Mouse { - fn clone(&self) -> Self { - Self { ..Self::new() } - } -} impl Mouse { - pub fn new() -> Self { + pub fn new() -> anyhow::Result { #[allow(unused_mut)] - let mut enigo = Enigo::new(); + let mut enigo = Enigo::new(&enigo::Settings::default())?; // Lower delay for xdo, see #1 #[cfg(target_os = "linux")] enigo.set_delay(100); - Mouse { + Ok(Mouse { enigo, error_accumulator: Vector2::zero(), - } + }) } // mouse movement is pixel perfect, so we keep track of the error. @@ -75,13 +70,13 @@ impl Mouse { if let Some(rounded) = rounded.cast::() { if rounded != Vector2::zero() { // In enigo, +y is toward the bottom - self.enigo.mouse_move_relative(rounded.x, rounded.y); + self.enigo.move_mouse(rounded.x, rounded.y, Coordinate::Rel).unwrap(); } } } pub fn mouse_move_absolute_pixel(&mut self, offset: Vector2) { - self.enigo.mouse_move_to(offset.x, offset.y); + self.enigo.move_mouse(offset.x, offset.y, Coordinate::Abs).unwrap(); } pub fn enigo(&mut self) -> &mut Enigo { diff --git a/src/opts.rs b/src/opts.rs index 67932e1..d899fe7 100644 --- a/src/opts.rs +++ b/src/opts.rs @@ -1,26 +1,22 @@ use std::{path::PathBuf, str::FromStr}; -use clap::Clap; +use clap::{Parser, ValueEnum}; /// Input mapper from gamepad keypress and movement to mouse and keyboard. /// /// See for more /// information about features and configuration file format. -#[derive(Debug, Clap)] -#[clap(version = clap::crate_version!())] -#[clap(setting = clap::AppSettings::ColoredHelp)] +#[derive(Debug, Parser)] +#[command(author, version, about)] pub struct Opts { /// Force the use of a specific backend for gamepad access. - #[clap(short, long)] - #[clap(setting = clap::ArgSettings::Hidden)] - #[clap(possible_values = &["sdl2", "hidapi"])] + #[arg(short, long)] pub backend: Option, - #[clap(subcommand)] + #[command(subcommand)] pub cmd: Option, } -#[derive(Debug, Clap)] -#[clap(setting = clap::AppSettings::ColoredHelp)] +#[derive(Debug, Copy, Clone, ValueEnum)] pub enum Backend { #[cfg(feature = "sdl2")] Sdl, @@ -28,13 +24,12 @@ pub enum Backend { Hid, } -#[derive(Debug, Clap)] -#[clap(setting = clap::AppSettings::ColoredHelp)] +#[derive(Debug, Parser)] pub enum Cmd { /// Validate the syntax of a configuration file. Validate(Run), /// Compute the value of REAL_WORLD_CALIBRATION. - #[clap(setting = clap::AppSettings::Hidden)] + #[command(hide = true)] FlickCalibrate, /// Run the program using the specified configuration file. Run(Run), @@ -42,8 +37,7 @@ pub enum Cmd { List, } -#[derive(Debug, Clap)] -#[clap(setting = clap::AppSettings::ColoredHelp)] +#[derive(Debug, Parser)] pub struct Run { /// Configuration file to use. pub mapping_file: PathBuf,