#mouse-input #virtio #decoder #keyboard

virtio-input-decoder

A simple decoder for virtio keyboard and mouse

5 releases

0.1.4 May 6, 2021
0.1.3 Apr 19, 2021
0.1.2 Apr 19, 2021
0.1.1 Apr 19, 2021
0.1.0 Apr 19, 2021

#1801 in Hardware support

Download history 4/week @ 2024-07-22 14/week @ 2024-07-29 7/week @ 2024-08-05 11/week @ 2024-08-26 10/week @ 2024-09-02 14/week @ 2024-09-09 23/week @ 2024-09-16 51/week @ 2024-09-23 47/week @ 2024-09-30 18/week @ 2024-10-07 17/week @ 2024-10-14 20/week @ 2024-10-21 23/week @ 2024-10-28 13/week @ 2024-11-04

74 downloads per month

GPL-3.0-or-later

16KB
386 lines

VirtIO 输入设备解码器

仅包含部分键盘按键、鼠标的按键解码(virtio) 解码需要传入 event_type、code、value 三个值 鼠标滚轮会同时以 1、2 编码 even_type,为了避免出错,解码器只处理编号 2

VirtIO Input Decoder

Only support part of keyboard and mouse input. You should provide event_type, code and value to the deocder MouseScroll has event_type both 1 and 2, in case of resulting error, decoder will only deal with the event_type 2 for mouse scroll

Example

use virtio_input_decoder::{
    Decoder, Mouse, DecodeType
};
let mouse = Decoder::decode(2, 8, 1).unwrap();
assert_eq!(mouse, DecodeType::Mouse(Mouse::ScrollUp));

2021年4月15日 zg

No runtime deps