if (chr) *chr = 0; Mouse::Mouse_shapes saveshape = mouse->get_shape(); if (shape != Mouse::dontchange) mouse->set_shape(shape); mouse->show(); gwin->show(1); int ret = Get_click(x, y, chr); mouse->set_shape(saveshape); return (ret);
while (1) { SDL_Event event; Delay();  mouse->hide(); mouse_update = 0;  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->move(event.motion.x >> scale, event.motion.y >> scale); mouse_update = 1; 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; } }  mouse->show();  if (!gwin->show() && mouse_update) 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->get_shape();	if (shape != Mouse::dontchange)		mouse->set_shape(shape);	mouse->show();	gwin->show(1);			// Want to see new mouse.	int ret = Get_click(x, y, chr);	mouse->set_shape(saveshape);	return (ret);	}