Mercurial > mplayer.hg
comparison libvo/x11_common.c @ 28133:272238675b78
Simplify handling of X11 key events that are just passed through.
author | reimar |
---|---|
date | Sat, 20 Dec 2008 10:25:13 +0000 |
parents | a318969a4f45 |
children | 31ea1d682c7b |
comparison
equal
deleted
inserted
replaced
28132:c28c36d595d5 | 28133:272238675b78 |
---|---|
580 } | 580 } |
581 #endif | 581 #endif |
582 | 582 |
583 void vo_x11_putkey(int key) | 583 void vo_x11_putkey(int key) |
584 { | 584 { |
585 static const char *passthrough_keys = " -+*/<>`~!@#$%^&()_{}:;\"\',.?\\|=[]"; | |
586 if ((key >= 'a' && key <= 'z') || | |
587 (key >= 'A' && key <= 'Z') || | |
588 (key >= '0' && key <= '9') || | |
589 (key > 0 && key < 256 && strchr(passthrough_keys, key))) | |
590 mplayer_put_key(key); | |
591 | |
585 switch (key) | 592 switch (key) |
586 { | 593 { |
587 case wsLeft: | 594 case wsLeft: |
588 mplayer_put_key(KEY_LEFT); | 595 mplayer_put_key(KEY_LEFT); |
589 break; | 596 break; |
594 mplayer_put_key(KEY_UP); | 601 mplayer_put_key(KEY_UP); |
595 break; | 602 break; |
596 case wsDown: | 603 case wsDown: |
597 mplayer_put_key(KEY_DOWN); | 604 mplayer_put_key(KEY_DOWN); |
598 break; | 605 break; |
599 case wsSpace: | |
600 mplayer_put_key(' '); | |
601 break; | |
602 case wsEscape: | 606 case wsEscape: |
603 mplayer_put_key(KEY_ESC); | 607 mplayer_put_key(KEY_ESC); |
604 break; | 608 break; |
605 case wsTab: | 609 case wsTab: |
606 mplayer_put_key(KEY_TAB); | 610 mplayer_put_key(KEY_TAB); |
663 mplayer_put_key(KEY_F + 11); | 667 mplayer_put_key(KEY_F + 11); |
664 break; | 668 break; |
665 case wsF12: | 669 case wsF12: |
666 mplayer_put_key(KEY_F + 12); | 670 mplayer_put_key(KEY_F + 12); |
667 break; | 671 break; |
668 case wsMinus: | |
669 case wsGrayMinus: | 672 case wsGrayMinus: |
670 mplayer_put_key('-'); | 673 mplayer_put_key('-'); |
671 break; | 674 break; |
672 case wsPlus: | |
673 case wsGrayPlus: | 675 case wsGrayPlus: |
674 mplayer_put_key('+'); | 676 mplayer_put_key('+'); |
675 break; | 677 break; |
676 case wsGrayMul: | 678 case wsGrayMul: |
677 case wsMul: | |
678 mplayer_put_key('*'); | 679 mplayer_put_key('*'); |
679 break; | 680 break; |
680 case wsGrayDiv: | 681 case wsGrayDiv: |
681 case wsDiv: | |
682 mplayer_put_key('/'); | 682 mplayer_put_key('/'); |
683 break; | |
684 case wsLess: | |
685 mplayer_put_key('<'); | |
686 break; | |
687 case wsMore: | |
688 mplayer_put_key('>'); | |
689 break; | 683 break; |
690 case wsGray0: | 684 case wsGray0: |
691 mplayer_put_key(KEY_KP0); | 685 mplayer_put_key(KEY_KP0); |
692 break; | 686 break; |
693 case wsGrayEnd: | 687 case wsGrayEnd: |
736 mplayer_put_key(KEY_KPDEL); | 730 mplayer_put_key(KEY_KPDEL); |
737 break; | 731 break; |
738 case wsGrayEnter: | 732 case wsGrayEnter: |
739 mplayer_put_key(KEY_KPENTER); | 733 mplayer_put_key(KEY_KPENTER); |
740 break; | 734 break; |
741 case wsGrave: | |
742 mplayer_put_key('`'); | |
743 break; | |
744 case wsTilde: | |
745 mplayer_put_key('~'); | |
746 break; | |
747 case wsExclSign: | |
748 mplayer_put_key('!'); | |
749 break; | |
750 case wsAt: | |
751 mplayer_put_key('@'); | |
752 break; | |
753 case wsHash: | |
754 mplayer_put_key('#'); | |
755 break; | |
756 case wsDollar: | |
757 mplayer_put_key('$'); | |
758 break; | |
759 case wsPercent: | |
760 mplayer_put_key('%'); | |
761 break; | |
762 case wsCircumflex: | |
763 mplayer_put_key('^'); | |
764 break; | |
765 case wsAmpersand: | |
766 mplayer_put_key('&'); | |
767 break; | |
768 case wsobracket: | |
769 mplayer_put_key('('); | |
770 break; | |
771 case wscbracket: | |
772 mplayer_put_key(')'); | |
773 break; | |
774 case wsUnder: | |
775 mplayer_put_key('_'); | |
776 break; | |
777 case wsocbracket: | |
778 mplayer_put_key('{'); | |
779 break; | |
780 case wsccbracket: | |
781 mplayer_put_key('}'); | |
782 break; | |
783 case wsColon: | |
784 mplayer_put_key(':'); | |
785 break; | |
786 case wsSemicolon: | |
787 mplayer_put_key(';'); | |
788 break; | |
789 case wsDblQuote: | |
790 mplayer_put_key('\"'); | |
791 break; | |
792 case wsAcute: | |
793 mplayer_put_key('\''); | |
794 break; | |
795 case wsComma: | |
796 mplayer_put_key(','); | |
797 break; | |
798 case wsPoint: | |
799 mplayer_put_key('.'); | |
800 break; | |
801 case wsQuestSign: | |
802 mplayer_put_key('?'); | |
803 break; | |
804 case wsBSlash: | |
805 mplayer_put_key('\\'); | |
806 break; | |
807 case wsPipe: | |
808 mplayer_put_key('|'); | |
809 break; | |
810 case wsEqual: | |
811 mplayer_put_key('='); | |
812 break; | |
813 case wsosbrackets: | |
814 mplayer_put_key('['); | |
815 break; | |
816 case wscsbrackets: | |
817 mplayer_put_key(']'); | |
818 break; | |
819 | |
820 | |
821 default: | |
822 if ((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z') || | |
823 (key >= '0' && key <= '9')) | |
824 mplayer_put_key(key); | |
825 } | 735 } |
826 | 736 |
827 } | 737 } |
828 | 738 |
829 | 739 |