mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Update readme
This commit is contained in:
@@ -4,6 +4,8 @@ rog-core is a utility for Linux to control many aspects (eventually) of the ASUS
|
|||||||
|
|
||||||
The laptop I currently have is the GX502RW and so I'll be using that for the basis of this app. If I get wireshark captures from others with different ROG laptops then I should be able to add something like laptop and feature detection.
|
The laptop I currently have is the GX502RW and so I'll be using that for the basis of this app. If I get wireshark captures from others with different ROG laptops then I should be able to add something like laptop and feature detection.
|
||||||
|
|
||||||
|
This is not the optimal solution as I'm using libusb to capture the interface that contains the unread keys (kernel doesn't read them), which removes the volume+media control keys also. I'm now looking at the kernel source to see if I can add the inputs correctly so they show up as proper evdev events.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- `rustc`, `cargo`
|
- `rustc`, `cargo`
|
||||||
@@ -101,4 +103,4 @@ Then do `lsusb -vd 0b05:1866 > ~/laptop_info` and give that to me.
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Mozilla Public License 2 (MPL-2.0)
|
Mozilla Public License 2 (MPL-2.0)
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ impl RogCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dev_handle.set_auto_detach_kernel_driver(true).unwrap();
|
dev_handle.set_auto_detach_kernel_driver(true).unwrap();
|
||||||
|
dev_handle
|
||||||
|
.claim_interface(keys_interface_num)
|
||||||
|
.map_err(|err| AuraError::UsbError(err))?;
|
||||||
|
|
||||||
Ok(RogCore {
|
Ok(RogCore {
|
||||||
handle: dev_handle,
|
handle: dev_handle,
|
||||||
@@ -164,9 +167,6 @@ impl RogCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn poll_keyboard(&mut self, buf: &mut [u8; 32]) -> Result<Option<usize>, AuraError> {
|
pub fn poll_keyboard(&mut self, buf: &mut [u8; 32]) -> Result<Option<usize>, AuraError> {
|
||||||
self.handle
|
|
||||||
.claim_interface(self.keys_interface_num)
|
|
||||||
.map_err(|err| AuraError::UsbError(err))?;
|
|
||||||
let res =
|
let res =
|
||||||
match self
|
match self
|
||||||
.handle
|
.handle
|
||||||
@@ -174,6 +174,7 @@ impl RogCore {
|
|||||||
{
|
{
|
||||||
Ok(o) => {
|
Ok(o) => {
|
||||||
if self.laptop.borrow().hotkey_group_bytes().contains(&buf[0]) {
|
if self.laptop.borrow().hotkey_group_bytes().contains(&buf[0]) {
|
||||||
|
println!("{:?}", buf);
|
||||||
Ok(Some(o))
|
Ok(Some(o))
|
||||||
} else {
|
} else {
|
||||||
Ok(None)
|
Ok(None)
|
||||||
@@ -181,9 +182,6 @@ impl RogCore {
|
|||||||
}
|
}
|
||||||
Err(err) => Err(AuraError::UsbError(err)),
|
Err(err) => Err(AuraError::UsbError(err)),
|
||||||
};
|
};
|
||||||
self.handle
|
|
||||||
.release_interface(self.keys_interface_num)
|
|
||||||
.map_err(|err| AuraError::UsbError(err))?;
|
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,10 +141,11 @@ impl Laptop for LaptopGX502GW {
|
|||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
if key_byte != 0 {
|
if key_byte != 0 {
|
||||||
info!("Unmapped key: {:X?}", &key_byte);
|
info!("Unmapped key: {:?}, {:X?}", &key_byte, &key_byte);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
info!("Pressed: {:?}, {:X?}", &key_byte, &key_byte);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
fn hotkey_group_bytes(&self) -> &[u8] {
|
fn hotkey_group_bytes(&self) -> &[u8] {
|
||||||
|
|||||||
Reference in New Issue
Block a user