src/video/gem/SDL_gemevents.c
branchSDL-1.2
changeset 6649 1aab0b09a0e3
parent 6648 5415ef59343a
child 9018 4a9c67d11c9f
equal deleted inserted replaced
6648:5415ef59343a 6649:1aab0b09a0e3
    85 		short buffer[8], kc, dummy;
    85 		short buffer[8], kc, dummy;
    86 
    86 
    87 		quit = 0;
    87 		quit = 0;
    88 
    88 
    89 		resultat = evnt_multi(
    89 		resultat = evnt_multi(
    90 			MU_MESAG|MU_TIMER|MU_KEYBD|MU_BUTTON|MU_M1,
    90 			MU_MESAG|MU_TIMER|MU_KEYBD,
    91 			0x101,7,prevmb,
    91 			0,0,0,
    92 			MO_LEAVE,prevmx,prevmy,1,1,
    92 			0,0,0,0,0,
    93 			0,0,0,0,0,
    93 			0,0,0,0,0,
    94 			buffer,
    94 			buffer,
    95 			10,
    95 			10,
    96 			&mousex,&mousey,&mouseb,&kstate,&kc,&dummy
    96 			&dummy,&dummy,&dummy,&kstate,&kc,&dummy
    97 		);
    97 		);
    98 
    98 
    99 		/* Message event ? */
    99 		/* Message event ? */
   100 		if (resultat & MU_MESAG)
   100 		if (resultat & MU_MESAG)
   101 			quit = do_messages(this, buffer);
   101 			quit = do_messages(this, buffer);
   102 
   102 
   103 		/* Special keys ? */
       
   104 		if (resultat & (MU_KEYBD|MU_BUTTON))
       
   105 			do_keyboard_special(kstate);
       
   106 
       
   107 		/* Keyboard event ? */
   103 		/* Keyboard event ? */
   108 		if (resultat & MU_KEYBD) {
   104 		if (resultat & MU_KEYBD) {
       
   105 			do_keyboard_special(kstate);
   109 			if (prevkc != kc) {
   106 			if (prevkc != kc) {
   110 				do_keyboard(kc);
   107 				do_keyboard(kc);
   111 				prevkc = kc;
   108 				prevkc = kc;
   112 			} else {
   109 			} else {
   113 				/* Avoid looping, if repeating same key */
   110 				/* Avoid looping, if repeating same key */
   114 				quit = 1;
   111 				quit = 1;
   115 			}
   112 			}
   116 		}
   113 		}
   117 
   114 
   118 		/* Mouse motion event ? */
       
   119 		if (resultat & MU_M1) {
       
   120 			do_mouse_motion(this, mousex, mousey);
       
   121 			prevmx = mousex;
       
   122 			prevmy = mousey;
       
   123 		}
       
   124 
       
   125 		/* Mouse button event ? */
       
   126 		if (resultat & MU_BUTTON) {
       
   127 			do_mouse_buttons(this, mouseb);
       
   128 			prevmb = mouseb & 7;
       
   129 		}
       
   130 
       
   131 		/* Timer event ? */
   115 		/* Timer event ? */
   132 		if ((resultat & MU_TIMER) || quit)
   116 		if ((resultat & MU_TIMER) || quit)
   133 			break;
   117 			break;
   134 	}
   118 	}
       
   119 
       
   120 	/* Update mouse state */
       
   121 	graf_mkstate(&mousex, &mousey, &mouseb, &kstate);
       
   122 	do_keyboard_special(kstate);
       
   123 	do_mouse_motion(this, mousex, mousey);
       
   124 	do_mouse_buttons(this, mouseb);
   135 
   125 
   136 	/* Now generate keyboard events */
   126 	/* Now generate keyboard events */
   137 	for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
   127 	for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
   138 		/* Key pressed ? */
   128 		/* Key pressed ? */
   139 		if (gem_currentkeyboard[i] && !gem_previouskeyboard[i])
   129 		if (gem_currentkeyboard[i] && !gem_previouskeyboard[i])