4444//! Unicode characters (where possible) according to the currently selected
4545//! `KeyboardLayout`.
4646//!
47- //! There is also `Keyboard ` which combines the above three functions into a
47+ //! There is also `PS2Keyboard ` which combines the above three functions into a
4848//! single object.
4949//!
5050//! See the [`examples`](./examples) folder for more details.
@@ -319,9 +319,9 @@ pub use crate::scancodes::{ScancodeSet1, ScancodeSet2};
319319//
320320// ****************************************************************************
321321
322- /// Encapsulates decode/sampling logic, and handles state transitions and key events.
322+ /// Encapsulates decode/sampling logic, and handles state transitions and key events for PS/2 Keyboards
323323#[ derive( Debug ) ]
324- pub struct Keyboard < L , S >
324+ pub struct PS2Keyboard < L , S >
325325where
326326 S : ScancodeSet ,
327327 L : KeyboardLayout ,
@@ -789,14 +789,14 @@ const SLS: char = '\\';
789789//
790790// ****************************************************************************
791791
792- impl < L , S > Keyboard < L , S >
792+ impl < L , S > PS2Keyboard < L , S >
793793where
794794 L : KeyboardLayout ,
795795 S : ScancodeSet ,
796796{
797797 /// Make a new Keyboard object with the given layout.
798- pub const fn new ( scancode_set : S , layout : L , handle_ctrl : HandleControl ) -> Keyboard < L , S > {
799- Keyboard {
798+ pub const fn new ( scancode_set : S , layout : L , handle_ctrl : HandleControl ) -> PS2Keyboard < L , S > {
799+ PS2Keyboard {
800800 ps2_decoder : Ps2Decoder :: new ( ) ,
801801 scancode_set,
802802 event_decoder : EventDecoder :: new ( layout, handle_ctrl) ,
@@ -1329,7 +1329,7 @@ impl Modifiers {
13291329mod test {
13301330 use super :: * ;
13311331
1332- fn add_bytes < L , S > ( keyboard : & mut Keyboard < L , S > , test_sequence : & [ ( u8 , Option < KeyEvent > ) ] )
1332+ fn add_bytes < L , S > ( keyboard : & mut PS2Keyboard < L , S > , test_sequence : & [ ( u8 , Option < KeyEvent > ) ] )
13331333 where
13341334 L : KeyboardLayout ,
13351335 S : ScancodeSet ,
@@ -1348,7 +1348,7 @@ mod test {
13481348 }
13491349
13501350 fn process_keyevents < L , S > (
1351- keyboard : & mut Keyboard < L , S > ,
1351+ keyboard : & mut PS2Keyboard < L , S > ,
13521352 test_sequence : & [ ( KeyEvent , Option < DecodedKey > ) ] ,
13531353 ) where
13541354 L : KeyboardLayout ,
@@ -1370,7 +1370,7 @@ mod test {
13701370
13711371 #[ test]
13721372 fn test_f9 ( ) {
1373- let mut k = Keyboard :: new (
1373+ let mut k = PS2Keyboard :: new (
13741374 ScancodeSet2 :: new ( ) ,
13751375 layouts:: Us104Key ,
13761376 HandleControl :: MapLettersToUnicode ,
@@ -1397,7 +1397,7 @@ mod test {
13971397
13981398 #[ test]
13991399 fn test_f9_word ( ) {
1400- let mut k = Keyboard :: new (
1400+ let mut k = PS2Keyboard :: new (
14011401 ScancodeSet2 :: new ( ) ,
14021402 layouts:: Us104Key ,
14031403 HandleControl :: MapLettersToUnicode ,
@@ -1410,7 +1410,7 @@ mod test {
14101410
14111411 #[ test]
14121412 fn test_f9_byte ( ) {
1413- let mut k = Keyboard :: new (
1413+ let mut k = PS2Keyboard :: new (
14141414 ScancodeSet2 :: new ( ) ,
14151415 layouts:: Us104Key ,
14161416 HandleControl :: MapLettersToUnicode ,
@@ -1422,7 +1422,7 @@ mod test {
14221422
14231423 #[ test]
14241424 fn test_keyup_keydown ( ) {
1425- let mut k = Keyboard :: new (
1425+ let mut k = PS2Keyboard :: new (
14261426 ScancodeSet2 :: new ( ) ,
14271427 layouts:: Us104Key ,
14281428 HandleControl :: MapLettersToUnicode ,
@@ -1438,7 +1438,7 @@ mod test {
14381438
14391439 #[ test]
14401440 fn test_f5 ( ) {
1441- let mut k = Keyboard :: new (
1441+ let mut k = PS2Keyboard :: new (
14421442 ScancodeSet2 :: new ( ) ,
14431443 layouts:: Us104Key ,
14441444 HandleControl :: MapLettersToUnicode ,
@@ -1465,7 +1465,7 @@ mod test {
14651465
14661466 #[ test]
14671467 fn test_f5_up ( ) {
1468- let mut k = Keyboard :: new (
1468+ let mut k = PS2Keyboard :: new (
14691469 ScancodeSet2 :: new ( ) ,
14701470 layouts:: Us104Key ,
14711471 HandleControl :: MapLettersToUnicode ,
@@ -1512,7 +1512,7 @@ mod test {
15121512
15131513 #[ test]
15141514 fn test_shift ( ) {
1515- let mut k = Keyboard :: new (
1515+ let mut k = PS2Keyboard :: new (
15161516 ScancodeSet2 :: new ( ) ,
15171517 layouts:: Uk105Key ,
15181518 HandleControl :: MapLettersToUnicode ,
@@ -1582,7 +1582,7 @@ mod test {
15821582
15831583 #[ test]
15841584 fn test_ctrl ( ) {
1585- let mut k = Keyboard :: new (
1585+ let mut k = PS2Keyboard :: new (
15861586 ScancodeSet2 :: new ( ) ,
15871587 layouts:: Us104Key ,
15881588 HandleControl :: MapLettersToUnicode ,
@@ -1628,7 +1628,7 @@ mod test {
16281628
16291629 #[ test]
16301630 fn test_numlock ( ) {
1631- let mut k = Keyboard :: new (
1631+ let mut k = PS2Keyboard :: new (
16321632 ScancodeSet2 :: new ( ) ,
16331633 layouts:: Uk105Key ,
16341634 HandleControl :: MapLettersToUnicode ,
@@ -1659,7 +1659,7 @@ mod test {
16591659
16601660 #[ test]
16611661 fn test_set_1_down_up_down ( ) {
1662- let mut k = Keyboard :: new (
1662+ let mut k = PS2Keyboard :: new (
16631663 ScancodeSet1 :: new ( ) ,
16641664 layouts:: Us104Key ,
16651665 HandleControl :: MapLettersToUnicode ,
@@ -1675,7 +1675,7 @@ mod test {
16751675
16761676 #[ test]
16771677 fn test_set_1_ext_down_up_down ( ) {
1678- let mut k = Keyboard :: new (
1678+ let mut k = PS2Keyboard :: new (
16791679 ScancodeSet1 :: new ( ) ,
16801680 layouts:: Us104Key ,
16811681 HandleControl :: MapLettersToUnicode ,
@@ -1697,7 +1697,7 @@ mod test {
16971697
16981698 #[ test]
16991699 fn test_set_2_poweron ( ) {
1700- let mut k = Keyboard :: new (
1700+ let mut k = PS2Keyboard :: new (
17011701 ScancodeSet2 :: new ( ) ,
17021702 layouts:: Us104Key ,
17031703 HandleControl :: MapLettersToUnicode ,
@@ -1711,7 +1711,7 @@ mod test {
17111711
17121712 #[ test]
17131713 fn test_set_2_toomanykeys ( ) {
1714- let mut k = Keyboard :: new (
1714+ let mut k = PS2Keyboard :: new (
17151715 ScancodeSet2 :: new ( ) ,
17161716 layouts:: Us104Key ,
17171717 HandleControl :: MapLettersToUnicode ,
@@ -1725,7 +1725,7 @@ mod test {
17251725
17261726 #[ test]
17271727 fn test_set_2_down_up ( ) {
1728- let mut k = Keyboard :: new (
1728+ let mut k = PS2Keyboard :: new (
17291729 ScancodeSet2 :: new ( ) ,
17301730 layouts:: Us104Key ,
17311731 HandleControl :: MapLettersToUnicode ,
@@ -1746,7 +1746,7 @@ mod test {
17461746
17471747 #[ test]
17481748 fn test_set_2_ext_down_up ( ) {
1749- let mut k = Keyboard :: new (
1749+ let mut k = PS2Keyboard :: new (
17501750 ScancodeSet2 :: new ( ) ,
17511751 layouts:: Us104Key ,
17521752 HandleControl :: MapLettersToUnicode ,
@@ -1763,7 +1763,7 @@ mod test {
17631763
17641764 #[ test]
17651765 fn test_pause_set1 ( ) {
1766- let mut k = Keyboard :: new (
1766+ let mut k = PS2Keyboard :: new (
17671767 ScancodeSet1 :: new ( ) ,
17681768 layouts:: Uk105Key ,
17691769 HandleControl :: MapLettersToUnicode ,
@@ -1813,7 +1813,7 @@ mod test {
18131813
18141814 #[ test]
18151815 fn test_pause_set2 ( ) {
1816- let mut k = Keyboard :: new (
1816+ let mut k = PS2Keyboard :: new (
18171817 ScancodeSet2 :: new ( ) ,
18181818 layouts:: Uk105Key ,
18191819 HandleControl :: MapLettersToUnicode ,
@@ -1864,7 +1864,7 @@ mod test {
18641864
18651865 #[ test]
18661866 fn test_pause_events ( ) {
1867- let mut k = Keyboard :: new (
1867+ let mut k = PS2Keyboard :: new (
18681868 ScancodeSet2 :: new ( ) ,
18691869 layouts:: Uk105Key ,
18701870 HandleControl :: MapLettersToUnicode ,
@@ -1911,7 +1911,7 @@ mod test {
19111911
19121912 #[ test]
19131913 fn test_print_screen_set1 ( ) {
1914- let mut k = Keyboard :: new (
1914+ let mut k = PS2Keyboard :: new (
19151915 ScancodeSet1 :: new ( ) ,
19161916 layouts:: Uk105Key ,
19171917 HandleControl :: MapLettersToUnicode ,
@@ -1961,7 +1961,7 @@ mod test {
19611961
19621962 #[ test]
19631963 fn test_print_screen_set2 ( ) {
1964- let mut k = Keyboard :: new (
1964+ let mut k = PS2Keyboard :: new (
19651965 ScancodeSet2 :: new ( ) ,
19661966 layouts:: Uk105Key ,
19671967 HandleControl :: MapLettersToUnicode ,
@@ -2014,7 +2014,7 @@ mod test {
20142014
20152015 #[ test]
20162016 fn test_print_screen_events ( ) {
2017- let mut k = Keyboard :: new (
2017+ let mut k = PS2Keyboard :: new (
20182018 ScancodeSet2 :: new ( ) ,
20192019 layouts:: Uk105Key ,
20202020 HandleControl :: MapLettersToUnicode ,
@@ -2061,7 +2061,7 @@ mod test {
20612061
20622062 #[ test]
20632063 fn test_modifier_state_shift ( ) {
2064- let mut k = Keyboard :: new (
2064+ let mut k = PS2Keyboard :: new (
20652065 ScancodeSet2 :: new ( ) ,
20662066 layouts:: Uk105Key ,
20672067 HandleControl :: MapLettersToUnicode ,
0 commit comments