Re: esc detector wont run -- 'out of scope'
Evan Ramos <[email protected]> Wed, 15 Mar 2017 17:29:40 -0500
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <CAJFC=+h-bPqYfux=P78b-o6GsP4i213mETZxEv7tE6T1KBz7vw@mail.gmail.com> |
Try "SDL_Keycode". -H ----- "After you finish the first 90% of a project, you have to finish the other 90%." - Michael Abrash On Wed, Mar 15, 2017 at 4:32 PM, speartip <[email protected]> wrote: > For what ever reason I get an out of scope error with the following key > presser > > > > Code: > > > while (gameRunning) > { > if (SDL_PollEvent(&event)) > { > if (event.type == SDL_QUIT) > { > gameRunning = false; > } > > if (event.type == SDL_KEYDOWN) > { > SDL_Key keyPressed = event.key.keysym.sym; > > switch (keyPressed) > { > case SDLK_ESCAPE: > gameRunning = false; > break; > } > } > } > } > > > > > > > > Code: > > > ..\src\drawLine.cpp:39:13: error: 'SDLKey' was not declared in this scope > SDLKey keyPressed = event.key.keysym.sym; > ^ > ..\src\drawLine.cpp:41:21: error: 'keyPressed' was not declared in this > scope > switch (keyPressed) > > > > > Got to be something simple! > > _______________________________________________ > SDL mailing list > [email protected] > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org >