Skip to content

Commit

Permalink
fixed bug with searching for input device
Browse files Browse the repository at this point in the history
  • Loading branch information
jpodeszwik committed Oct 20, 2018
1 parent b28e303 commit 4ba9fa5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/input_device.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use uinput::{default, Device};
use uinput::Error;
use uinput::{Error, Device};
use uinput::event::Keyboard::All;
use uinput;

pub fn create() -> Result<Device, String> {
create_device()
.map_err(|e| format!("{}", e))
}

fn create_device() -> Result<Device, Error> {
let device = default()?
let device = uinput::open("/dev/uinput")?
.name("razer-naga-virtual-keyboard")?
.event(All)?
.create()?;
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ extern crate serde_derive;
extern crate toml;
extern crate uinput;

use std::env;
use std::thread;
use std::{env, thread};
use std::time::Duration;

mod naga;
Expand Down

0 comments on commit 4ba9fa5

Please sign in to comment.