afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
988 stars 68 forks source link

Keyboard Input may not Properly be Captured #27

Closed Ragora closed 8 years ago

Ragora commented 8 years ago

I only noticed this during trying to check into #26 on my Linux machine here. Probably caused by my rapid clicking through the menus, but that apparently caused the game to be unable to capture my keyboard input (at least for the name entry after you select your class).

I'll have to see if its easily reproducible.

Edit So far I haven't been able to reproduce, it is possible that it was just a bug in my desktop environment as my input just really wasn't shifting from CLion to OpenTESArena.

afritz1 commented 8 years ago

All of the keyboard input for name entry occurs in ChooseNamePanel::handleEvents(). It's kind of messy for the moment, but it should work.

SDL listens for any new events, like changes in button state, so if it didn't hear your key press, then perhaps the application window wasn't focused properly (like you said with your environment).

kcat commented 8 years ago

Something to watch for is that if Debug::check handles a failure case, the app will stop and wait for std::getch before exiting. At least with Linux, this means having to go back to the terminal and press enter to close the window.

afritz1 commented 8 years ago

It's the same with Windows. The behavior for Debug::check() could be changed in the future if it would be more desirable to write to a log.txt file instead.

afritz1 commented 8 years ago

Are there still any problems with this? I'm thinking that if it wasn't easily reproducible then I should close this issue for now and reopen it later if there are other reports.

Ragora commented 8 years ago

Probably should for now, I haven't been around to test things lately.