We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 322 - mod state are note handle correctly
Summary: mod state are note handle correctly
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 1.2.11
Hardware: x86 Linux
: P1 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-04 13:26 UTC by EdB
Modified: 2007-07-06 00:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EdB 2006-09-04 13:26:18 UTC
i've an hotkey in my app to switch bettewen fullscreen/windowed mode.
the first time i use it, i have to press twice the mod key (here shift) to activate it and when swithing is done to repress the mod key like state are lost when switching ...

testcase :
#include <SDL/SDL.h>

#include <iostream>

int main (int argc, char **argv) {
	SDL_Init (SDL_INIT_VIDEO);

	SDL_SetVideoMode (1024, 768, 0, SDL_FULLSCREEN);
	SDL_WM_SetCaption ("sdl_bug", "sdl_bug");

	int done = 0;
	bool f = true;
	while (!done) {
		SDL_Delay(10);

		SDL_Event event;
		while (SDL_PollEvent(&event)) {
			if (event.key.keysym.sym == SDLK_ESCAPE)
				done = 1;
			if (event.type ==SDL_KEYDOWN and event.key.keysym.sym == SDLK_f and event.key.keysym.mod&KMOD_SHIFT) {
				int flag = 0;
				if (f)
					flag &= ~SDL_FULLSCREEN;
				else
					flag |= SDL_FULLSCREEN;
				f = !f;
				SDL_SetVideoMode (1024, 768, 0, flag);
			}
		}
	}

	SDL_Quit();
	return 0;
}
Comment 1 Ryan C. Gordon 2007-06-02 13:58:55 UTC
Bumping a bunch of bugs to Priority 1 for consideration for the 1.2.12 release.

--ryan.

Comment 2 Sam Lantinga 2007-07-06 00:46:03 UTC
This is fixed in subversion revision 3155.  Thanks!