Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Keyboard::Other(XXX).click() clicking wrong key. #11

@lennon03

Description

@lennon03

I'm trying to mute sound using keyboard using this program:

When i click the mute button it works and says Jackpot, but at the start of my program, it clicks the d lettter.

Rustc version: 1.71.1
Mki version: 0.2.3

use mki::{bind_any_key, Action, Keyboard};
use Keyboard::*;

fn main() {
    println!("Hello, world!");

    Other(173).click();

    bind_any_key(Action::handle_kb(|key| {
        println!("Pessed key: {:?}", key);
        if let Other(173) = key {
            println!("Jackpot !!");
        }
    }));

    thread::sleep(Duration::from_secs(69));

    /* $obj = new-object -com wscript.shell
    $obj.SendKeys([char]173) */
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions