MCPcopy Create free account
hub / github.com/TyberiusPrime/KeyToKey / hex_digit_to_keycode_dvorak

Function hex_digit_to_keycode_dvorak

src/lib.rs:273–295  ·  view source on GitHub ↗
(digit: char)

Source from the content-addressed store, hash-verified

271 }
272}
273fn hex_digit_to_keycode_dvorak(digit: char) -> KeyCode {
274 //todo which way it's shorter in machine code this or
275 //with the derived nums...
276 match digit {
277 '0' => KeyCode::Kb0,
278 '1' => KeyCode::Kb1,
279 '2' => KeyCode::Kb2,
280 '3' => KeyCode::Kb3,
281 '4' => KeyCode::Kb4,
282 '5' => KeyCode::Kb5,
283 '6' => KeyCode::Kb6,
284 '7' => KeyCode::Kb7,
285 '8' => KeyCode::Kb8,
286 '9' => KeyCode::Kb9,
287 'A' | 'a' => KeyCode::A,
288 'B' | 'b' => KeyCode::N,
289 'C' | 'c' => KeyCode::I,
290 'D' | 'd' => KeyCode::H,
291 'E' | 'e' => KeyCode::D,
292 'F' | 'f' => KeyCode::Y,
293 _ => panic!("Passed more than one digit to hex_digit_to_keycode"),
294 }
295}
296
297/// the handlers use this trait to generate their output
298pub trait USBKeyOut {

Callers 1

send_unicodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected