@@ -583,6 +583,8 @@ namespace erebos {
583
583
ERAPI bool fake_put (const Key& key);
584
584
585
585
#elif defined(LINUX)
586
+ using PhysicalKeyboard = FILE*;
587
+ using VirtualKeyboard = int ;
586
588
587
589
/* !
588
590
* @brief determine which kind of event, see fake_put
@@ -595,14 +597,14 @@ namespace erebos {
595
597
/* !
596
598
* @return retrieve physical connected keyboard event path (see also get_key)
597
599
*/
598
- FILE* getev_physical_keyboard ();
600
+ PhysicalKeyboard getev_physical_keyboard ();
599
601
600
602
/* !
601
603
*
602
604
* @param physkb : the opened stream to keyboard event file
603
605
* @return pressed key
604
606
*/
605
- Key get_key (FILE* physkb);
607
+ Key get_key (PhysicalKeyboard physkb);
606
608
607
609
/* !
608
610
*
@@ -614,7 +616,7 @@ namespace erebos {
614
616
* @param version (default 0x03)
615
617
* @return a new file descriptor, representing the virtual keyboard, -1 otherwise
616
618
*/
617
- int new_virtual_kb_device (const char * name,
619
+ VirtualKeyboard new_virtual_kb_device (const char * name,
618
620
const bool & after_wait = true ,
619
621
const u16 & bus_type = 0x03 , // USB
620
622
const u16 & vendor = 0x01 ,
@@ -627,21 +629,21 @@ namespace erebos {
627
629
* @param type : press or release? (see KeyPressType)
628
630
* @return true if key pressed, false otherwise
629
631
*/
630
- bool fake_put (const int & devfd, const Key& key, const KeyPressType& type);
632
+ bool fake_put (const VirtualKeyboard & devfd, const Key& key, const KeyPressType& type);
631
633
632
634
/* !
633
635
* @param devfd : the virtual keyboard fd
634
636
* @return true if correctly destroyed, false otherwise
635
637
*/
636
- bool destroy_virtual_kb_device (const int & devfd);
638
+ bool destroy_virtual_kb_device (const VirtualKeyboard & devfd);
637
639
638
640
/* !
639
641
*
640
642
* @param devfd : the virtual keyboard fd
641
643
* @param key : key you wanna put
642
644
* @return true if key event emitted, false otherwise
643
645
*/
644
- inline bool fake_put (const int & devfd, const Key& key) {
646
+ inline bool fake_put (const VirtualKeyboard & devfd, const Key& key) {
645
647
if (!fake_put (devfd, key, KeyPressType::KEY_PRESS))
646
648
return false ;
647
649
0 commit comments