comparison src/video/fbcon/SDL_fbevents.c @ 1323:be736c197ceb

Fixed compile warning
author Sam Lantinga <slouken@libsdl.org>
date Fri, 03 Feb 2006 06:01:23 +0000
parents c9b51268668f
children 3692456e7b0f
comparison
equal deleted inserted replaced
1322:a4566d07718f 1323:be736c197ceb
672 int button; 672 int button;
673 673
674 while (ts_read(ts_dev, &sample, 1) > 0) { 674 while (ts_read(ts_dev, &sample, 1) > 0) {
675 button = (sample.pressure > 0) ? 1 : 0; 675 button = (sample.pressure > 0) ? 1 : 0;
676 button <<= 2; /* must report it as button 3 */ 676 button <<= 2; /* must report it as button 3 */
677 FB_vgamousecallback(button, 0, sample.x, sample.y); 677 FB_vgamousecallback(button, 0, sample.x, sample.y);
678 } 678 }
679 return; 679 return;
680 } 680 }
681 #endif /* HAVE_TSLIB */ 681 #endif /* HAVE_TSLIB */
682 682
711 case MOUSE_MS: 711 case MOUSE_MS:
712 case MOUSE_BM: 712 case MOUSE_BM:
713 packetsize = 3; 713 packetsize = 3;
714 break; 714 break;
715 case MOUSE_ELO: 715 case MOUSE_ELO:
716 packetsize = ELO_PACKET_SIZE; 716 /* try to read the next packet */
717 relative = 0; 717 if(eloReadPosition(this, mouse_fd, &dx, &dy, &button, &realx, &realy)) {
718 break; 718 button = (button & 0x01) << 2;
719 FB_vgamousecallback(button, 0, dx, dy);
720 }
721 return; /* nothing left to do */
719 case MOUSE_TSLIB: 722 case MOUSE_TSLIB:
720 #ifdef HAVE_TSLIB 723 #ifdef HAVE_TSLIB
721 handle_tslib(this); 724 handle_tslib(this);
722 #endif 725 #endif
723 return; /* nothing left to do */ 726 return; /* nothing left to do */
724 case NUM_MOUSE_DRVS: 727 default:
725 /* Uh oh.. */ 728 /* Uh oh.. */
726 packetsize = 0; 729 packetsize = 0;
727 break; 730 break;
728 } 731 }
729 732
730 /* Special handling for the quite sensitive ELO controller */ 733 /* Special handling for the quite sensitive ELO controller */
731 if (mouse_drv == MOUSE_ELO) { 734 if (mouse_drv == MOUSE_ELO) {
732 735
733 /* try to read the next packet */
734 if(eloReadPosition(this, mouse_fd, &dx, &dy, &button, &realx, &realy)) {
735 button = (button & 0x01) << 2;
736 FB_vgamousecallback(button, relative, dx, dy);
737 }
738
739 return;
740 } 736 }
741 737
742 /* Read as many packets as possible */ 738 /* Read as many packets as possible */
743 nread = read(mouse_fd, &mousebuf[start], BUFSIZ-start); 739 nread = read(mouse_fd, &mousebuf[start], BUFSIZ-start);
744 if ( nread < 0 ) { 740 if ( nread < 0 ) {
832 /* Get current mouse state */ 828 /* Get current mouse state */
833 button = (~mousebuf[i]) & 0x07; 829 button = (~mousebuf[i]) & 0x07;
834 dx = (signed char)mousebuf[i+1]; 830 dx = (signed char)mousebuf[i+1];
835 dy = -(signed char)mousebuf[i+2]; 831 dy = -(signed char)mousebuf[i+2];
836 break; 832 break;
837 /* 833 default:
838 case MOUSE_ELO:
839 if ( mousebuf[i] != ELO_START_BYTE ) {
840 i -= (packetsize-1);
841 continue;
842 }
843
844 if(!eloParsePacket(&(mousebuf[i]), &dx, &dy, &button)) {
845 i -= (packetsize-1);
846 continue;
847 }
848
849 button = (button & 0x01) << 2;
850
851 eloConvertXY(this, &dx, &dy);
852 break;
853 */
854
855 case MOUSE_ELO:
856 case NUM_MOUSE_DRVS:
857 /* Uh oh.. */ 834 /* Uh oh.. */
858 dx = 0; 835 dx = 0;
859 dy = 0; 836 dy = 0;
860 break; 837 break;
861 } 838 }