Skip to content

Commit

Permalink
Update to Godot 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
creatoy committed Jul 8, 2023
1 parent d43074b commit 6f92fe7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
cat>$bin_dir/../$bin_name.gdextension<<EOF
[configuration]
entry_symbol = "hid_lib_init"
compatibility_minimum = 4.0
compatibility_minimum = 4.1
[libraries]
${{ matrix.build }}.x86_64 = "bin/$bin_file"
EOF
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hid"
version = "0.0.1"
version = "0.0.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
## A hidapi extension for godot

> WIP
* Written by rust with gdext

> How to use it: Download the release archive and decompress it to your godot project root directory.

Example:
```
func _ready():
# List all connected HID devices.
var devices = Hid.list_devices()
print(devices)
var hid = Hid.new()
# Open by vender id and product id
hid.open(vid, pid)
# Or open by device path
#hid.open_path(path)
# Or open by serial number
#hid.open_serial(vid, pid, serial_number)
# Then you can read HID report data from device.
var report_recv = hid.read(64)
#var report_recv = hid.read_timeout(64, 10)
# And write report data to HID
hid.write(report_send)
```

0 comments on commit 6f92fe7

Please sign in to comment.