if (chr) *chr = 0; Mouse::Mouse_shapes saveshape = Mouse::mouse->get_shape(); if (shape != Mouse::dontchange) Mouse::mouse->set_shape(shape); Mouse::mouse->show(); gwin->show(1); int ret = Get_click(x, y, chr); Mouse::mouse->set_shape(saveshape); return (ret);
while (1) { SDL_Event event; Delay();  Mouse::mouse->hide(); Mouse::mouse_update = false;  while (SDL_PollEvent(&event)) switch (event.type) { case SDL_MOUSEBUTTONUP: if (event.button.button == 1) { x = event.button.x >> scale; y = event.button.y >> scale; return (1); } break; case SDL_MOUSEMOTION: Mouse::mouse->move(event.motion.x >> scale, event.motion.y >> scale); Mouse::mouse_update = true; break; case SDL_KEYDOWN: { int c = event.key.keysym.sym; if (c == SDLK_ESCAPE) return (0); if (chr) { *chr = (event.key.keysym.mod & KMOD_SHIFT) ? toupper(c) : c; return (1); } break; } case SDL_KEYUP: switch (event.key.keysym.sym) { case SDLK_RALT: case SDLK_RMETA: altkeys &= ~1; break; case SDLK_LALT: case SDLK_LMETA: altkeys &= ~2; break; default: break; } break; } Mouse::mouse->show();  if (!gwin->show() && Mouse::mouse_update) Mouse::mouse->blit_dirty(); } return (0);
int Get_click	(	int& x, int& y,			// Location returned (if not ESC).	Mouse::Mouse_shapes shape,	// Mouse shape to use.	char *chr			// Char. returned if not null.	)	{	if (chr)		*chr = 0;		// Init.	Mouse::Mouse_shapes saveshape = Mouse::mouse->get_shape();	if (shape != Mouse::dontchange)		Mouse::mouse->set_shape(shape);	Mouse::mouse->show();	gwin->show(1);			// Want to see new mouse.	int ret = Get_click(x, y, chr);	Mouse::mouse->set_shape(saveshape);	return (ret);	}