comparison src/video/fbcon/SDL_fbevents.c @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents 1e4ba2e063b4
children c0a74f199ecf
comparison
equal deleted inserted replaced
1360:70a9cfb4cf1b 1361:19418e4422cb
39 #include <linux/kd.h> 39 #include <linux/kd.h>
40 #include <linux/keyboard.h> 40 #include <linux/keyboard.h>
41 41
42 #include "SDL_timer.h" 42 #include "SDL_timer.h"
43 #include "SDL_mutex.h" 43 #include "SDL_mutex.h"
44 #include "SDL_sysevents.h" 44 #include "../SDL_sysvideo.h"
45 #include "SDL_sysvideo.h" 45 #include "../../events/SDL_sysevents.h"
46 #include "SDL_events_c.h" 46 #include "../../events/SDL_events_c.h"
47 #include "SDL_fbvideo.h" 47 #include "SDL_fbvideo.h"
48 #include "SDL_fbevents_c.h" 48 #include "SDL_fbevents_c.h"
49 #include "SDL_fbkeys.h" 49 #include "SDL_fbkeys.h"
50 50
51 #include "SDL_fbelo.h" 51 #include "SDL_fbelo.h"
314 NUM_MOUSE_DRVS 314 NUM_MOUSE_DRVS
315 } mouse_drv = MOUSE_NONE; 315 } mouse_drv = MOUSE_NONE;
316 316
317 void FB_CloseMouse(_THIS) 317 void FB_CloseMouse(_THIS)
318 { 318 {
319 #ifdef HAVE_TSLIB 319 #if SDL_INPUT_TSLIB
320 if (ts_dev != NULL) { 320 if (ts_dev != NULL) {
321 ts_close(ts_dev); 321 ts_close(ts_dev);
322 ts_dev = NULL; 322 ts_dev = NULL;
323 mouse_fd = -1; 323 mouse_fd = -1;
324 } 324 }
325 #endif /* HAVE_TSLIB */ 325 #endif /* SDL_INPUT_TSLIB */
326 if ( mouse_fd > 0 ) { 326 if ( mouse_fd > 0 ) {
327 close(mouse_fd); 327 close(mouse_fd);
328 } 328 }
329 mouse_fd = -1; 329 mouse_fd = -1;
330 } 330 }
499 499
500 mousedrv = SDL_getenv("SDL_MOUSEDRV"); 500 mousedrv = SDL_getenv("SDL_MOUSEDRV");
501 mousedev = SDL_getenv("SDL_MOUSEDEV"); 501 mousedev = SDL_getenv("SDL_MOUSEDEV");
502 mouse_fd = -1; 502 mouse_fd = -1;
503 503
504 #ifdef HAVE_TSLIB 504 #if SDL_INPUT_TSLIB
505 if ((mousedrv != NULL) && (SDL_strcmp(mousedrv, "TSLIB") == 0)) { 505 if ((mousedrv != NULL) && (SDL_strcmp(mousedrv, "TSLIB") == 0)) {
506 if (mousedev == NULL) mousedev = SDL_getenv("TSLIB_TSDEVICE"); 506 if (mousedev == NULL) mousedev = SDL_getenv("TSLIB_TSDEVICE");
507 if (mousedev != NULL) { 507 if (mousedev != NULL) {
508 ts_dev = ts_open(mousedev, 1); 508 ts_dev = ts_open(mousedev, 1);
509 if ((ts_dev != NULL) && (ts_config(ts_dev) >= 0)) { 509 if ((ts_dev != NULL) && (ts_config(ts_dev) >= 0)) {
516 } 516 }
517 } 517 }
518 mouse_drv = MOUSE_NONE; 518 mouse_drv = MOUSE_NONE;
519 return mouse_fd; 519 return mouse_fd;
520 } 520 }
521 #endif /* HAVE_TSLIB */ 521 #endif /* SDL_INPUT_TSLIB */
522 522
523 /* ELO TOUCHSCREEN SUPPORT */ 523 /* ELO TOUCHSCREEN SUPPORT */
524 524
525 if( (mousedrv != NULL) && (SDL_strcmp(mousedrv, "ELO") == 0) ) { 525 if( (mousedrv != NULL) && (SDL_strcmp(mousedrv, "ELO") == 0) ) {
526 mouse_fd = open(mousedev, O_RDWR); 526 mouse_fd = open(mousedev, O_RDWR);
661 } 661 }
662 } 662 }
663 } 663 }
664 664
665 /* Handle input from tslib */ 665 /* Handle input from tslib */
666 #ifdef HAVE_TSLIB 666 #if SDL_INPUT_TSLIB
667 static void handle_tslib(_THIS) 667 static void handle_tslib(_THIS)
668 { 668 {
669 struct ts_sample sample; 669 struct ts_sample sample;
670 int button; 670 int button;
671 671
674 button <<= 2; /* must report it as button 3 */ 674 button <<= 2; /* must report it as button 3 */
675 FB_vgamousecallback(button, 0, sample.x, sample.y); 675 FB_vgamousecallback(button, 0, sample.x, sample.y);
676 } 676 }
677 return; 677 return;
678 } 678 }
679 #endif /* HAVE_TSLIB */ 679 #endif /* SDL_INPUT_TSLIB */
680 680
681 /* For now, use MSC, PS/2, and MS protocols 681 /* For now, use MSC, PS/2, and MS protocols
682 Driver adapted from the SVGAlib mouse driver code (taken from gpm, etc.) 682 Driver adapted from the SVGAlib mouse driver code (taken from gpm, etc.)
683 */ 683 */
684 static void handle_mouse(_THIS) 684 static void handle_mouse(_THIS)
716 button = (button & 0x01) << 2; 716 button = (button & 0x01) << 2;
717 FB_vgamousecallback(button, 0, dx, dy); 717 FB_vgamousecallback(button, 0, dx, dy);
718 } 718 }
719 return; /* nothing left to do */ 719 return; /* nothing left to do */
720 case MOUSE_TSLIB: 720 case MOUSE_TSLIB:
721 #ifdef HAVE_TSLIB 721 #if SDL_INPUT_TSLIB
722 handle_tslib(this); 722 handle_tslib(this);
723 #endif 723 #endif
724 return; /* nothing left to do */ 724 return; /* nothing left to do */
725 default: 725 default:
726 /* Uh oh.. */ 726 /* Uh oh.. */