ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_x.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/video_x.cpp (file contents):
Revision 1.2 by cebix, 1999-10-03T16:20:08Z vs.
Revision 1.4 by cebix, 1999-10-04T21:07:18Z

# Line 61 | Line 61 | enum {
61  
62  
63   // Constants
64 < const char KEYCODE_FILE_NAME[] = SHAREDIR "keycodes";
64 > const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes";
65  
66  
67   // Global variables
# Line 75 | Line 75 | static pthread_t redraw_thread;                                                //
75   static bool has_dga = false;                                            // Flag: Video DGA capable
76  
77   static bool ctrl_down = false;                                          // Flag: Ctrl key pressed
78 + static bool caps_on = false;                                            // Flag: Caps Lock on
79   static bool quit_full_screen = false;                           // Flag: DGA close requested from redraw thread
80   static bool emerg_quit = false;                                         // Flag: Ctrl-Esc pressed, emergency quit requested from MacOS thread
81   static bool emul_suspended = false;                                     // Flag: Emulator suspended
# Line 539 | Line 540 | bool VideoInit(bool classic)
540          if (mode_str) {
541                  if (sscanf(mode_str, "win/%d/%d", &width, &height) == 2)
542                          display_type = DISPLAY_WINDOW;
543 <                else if (has_dga && strcmp(mode_str, "dga") == 0) {
543 >                else if (has_dga && sscanf(mode_str, "dga/%d/%d", &width, &height) == 2) {
544                          display_type = DISPLAY_DGA;
545 +                        if (width > DisplayWidth(x_display, screen))
546 +                                width = DisplayWidth(x_display, screen);
547 +                        if (height > DisplayHeight(x_display, screen))
548 +                                height = DisplayHeight(x_display, screen);
549 +                }
550 +                if (width <= 0)
551                          width = DisplayWidth(x_display, screen);
552 +                if (height <= 0)
553                          height = DisplayHeight(x_display, screen);
546                }
554          }
555  
556          // Initialize according to display type
# Line 968 | Line 975 | static void handle_events(void)
975                                          code = event2keycode((XKeyEvent *)&event);
976                                  if (code != -1) {
977                                          if (!emul_suspended) {
978 <                                                ADBKeyDown(code);
978 >                                                if (code == 0x39) {     // Caps Lock pressed
979 >                                                        if (caps_on) {
980 >                                                                ADBKeyUp(code);
981 >                                                                caps_on = false;
982 >                                                        } else {
983 >                                                                ADBKeyDown(code);
984 >                                                                caps_on = true;
985 >                                                        }
986 >                                                } else
987 >                                                        ADBKeyDown(code);
988                                                  if (code == 0x36)
989                                                          ctrl_down = true;
990                                          } else {
# Line 987 | Line 1003 | static void handle_events(void)
1003                                          code = keycode_table[((XKeyEvent *)&event)->keycode & 0xff];
1004                                  } else
1005                                          code = event2keycode((XKeyEvent *)&event);
1006 <                                if (code != -1) {
1006 >                                if (code != -1 && code != 0x39) {       // Don't propagate Caps Lock releases
1007                                          ADBKeyUp(code);
1008                                          if (code == 0x36)
1009                                                  ctrl_down = false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines