这是indexloc提供的服务,不要输入任何密码
Skip to content

[Feature Request] Add Display trait to Key enum #66

@alextremblay

Description

@alextremblay

Hello,

I would like to add the display trait to the Key enum. The way i picture this working is that all keys would display the same as they do in Debug, except the Key* variants would print without the Key prefix, the Num* variants would print without the Num prefix, and the punctuation characters (- = [ ] \ ; ' , . / ) would print literal punctuation characters. The keypad variants would remain the same, to distinguish them from from the regular number variants.

Ex:

use rdev::Key::*;
fn main() {
    println!("{} / {} / {} / {} / {} / {} / {}", Alt, F1, Num1, Minus, KeyQ, LeftBracket, Kp6)
}

would print:
Alt / F1 / 1 / - / Q / [ / Kp6

I can implement this and submit a PR if you'd like

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