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

Method as_modifier_bit

src/key_codes.rs:204–210  ·  view source on GitHub ↗

needed to build USB reports

(self)

Source from the content-addressed store, hash-verified

202 }
203 /// needed to build USB reports
204 pub fn as_modifier_bit(self) -> u8 {
205 if self.is_modifier() {
206 1 << (self.to_u8() - KeyCode::LCtrl.to_u8())
207 } else {
208 0
209 }
210 }
211 pub fn to_u8(self) -> u8 {
212 let u = (self as u32) - UNICODE_BELOW_256;
213 return u as u8;

Callers

nothing calls this directly

Calls 2

is_modifierMethod · 0.80
to_u8Method · 0.80

Tested by

no test coverage detected