deathkiller / jazz2

🎮 · Jazz² Resurrection: Open-source reimplementation of Jazz Jackrabbit 2
https://deat.tk/jazz2/
GNU General Public License v3.0
495 stars 18 forks source link

Feature request: Allow the process to be killed by pressing ALT-F4 #102

Closed RavenMacDaddy closed 2 years ago

RavenMacDaddy commented 2 years ago

Feature request: Allow the process to be killed by pressing ALT-F4

deathkiller commented 2 years ago

I didn't know it doesn't work, but it's probably bug in OpenTK library. It works good in C++ port which uses different library.

RavenMacDaddy commented 2 years ago

Found this in a thread and PR:

private void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
        {
            if (e.Key == OpenTK.Input.Key.F4 && keys.Contains(Keys.LeftAlt))
            {
                window.Close();
                return;

(I removed the RightAlt code since AltGr is not the same thing as Alt - see PR for the full code.)

Would that work?

deathkiller commented 2 years ago

Probably yes, but as I said I'm not going to fix it, because it's 3rd party bug, this is only workaround and it's already working in C++ port.

RavenMacDaddy commented 2 years ago

Now I get it, C++ version will supersede OpenTK.

deathkiller commented 2 years ago

Yes, exactly.

RavenMacDaddy commented 2 years ago

Closing as fixed by C++.