Merge pull request #164 from realffqq/feat/restore-java-gui
Some checks are pending
Build Linux Release / build-linux (push) Waiting to run

(feat/restore-java-gui) fix: pass ESC keypress to screen
This commit is contained in:
JuiceyDev 2026-03-10 15:28:25 +01:00 committed by GitHub
commit ae00c4719f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -2106,7 +2106,9 @@ void Minecraft::pauseGame()
{ {
if (screen != NULL) if (screen != NULL)
{ {
setScreen(NULL); // 4jcraft: Pass the keypress to the screen
// normally this would've been done in updateEvents(), but it works better here (for now atleast)
screen->keyPressed(0, Keyboard::KEY_ESCAPE);
return; return;
} }
#ifdef ENABLE_JAVA_GUIS #ifdef ENABLE_JAVA_GUIS

View file

@ -23,10 +23,9 @@ public:
Screen(); // 4J added Screen(); // 4J added
virtual void render(int xm, int ym, float a); virtual void render(int xm, int ym, float a);
protected:
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
public: public:
static std::wstring getClipboard(); virtual void keyPressed(wchar_t eventCharacter, int eventKey);
static std::wstring getClipboard();
static void setClipboard(const std::wstring& str); static void setClipboard(const std::wstring& str);
private: private:
Button *clickedButton; Button *clickedButton;