Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Do not merge yet) KEYMAPPER: Fix virtual mouse bound in small rectangle in VKBD #2462

Merged
merged 1 commit into from Sep 15, 2020

Conversation

@rsn8887
Copy link
Contributor

rsn8887 commented Sep 14, 2020

Without this PR, the virtual mouse, controlled via game controller analog stick, is stuck in a 320x200 top left rectangle when VKBD is displayed with graphics mode 2x in low res games like Dreamweb in-game. Note gfx mode 2x or higher has long been the default on almost all platforms that have at least 640x400 capability.

This bug is a consequence of g_gui.isActive() returning false when vkbd is being displayed (why is this?!?!). Due to this, the game resolution is used erroneously instead of the overlay resolution for clipping the virtual mouse.

This should be included for 2.2.0 Switch and Vita releases, otherwise VKBD is unusable in 320x200 games in docked Switch modes and VitaTV modes due to not being able to move the mouse pointer over the whole keyboard.

@deepcode-ci-bot
Copy link

deepcode-ci-bot bot commented Sep 14, 2020

Congratulations 🎉. DeepCode analyzed your code in 2.663 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@rsn8887 rsn8887 force-pushed the rsn8887:vkeybdfix branch 2 times, most recently from f968da3 to baf6f71 Sep 14, 2020
@rsn8887 rsn8887 requested a review from bgK Sep 14, 2020
@rsn8887 rsn8887 force-pushed the rsn8887:vkeybdfix branch 2 times, most recently from f2dd7c0 to eb0c6d2 Sep 14, 2020
@rsn8887 rsn8887 changed the title EVENTS: Fix virtual mouse bound in small rectangle in VKBD KEYMAPPER: Fix virtual mouse bound in small rectangle in VKBD Sep 14, 2020
@ccawley2011
Copy link
Member

ccawley2011 commented Sep 14, 2020

This bug is a consequence of g_gui.isActive() returning false when vkbd is being displayed (why is this?!?!)

This is because the virtual keyboard is drawn directly on the overlay, instead of using the GUI. The isOverlayVisible() function introduced in PR #2464 could be used to detect any situation when the overlay is active, but the GUI isn't, but due to the nature of that PR, I wouldn't advise backporting it to branch-2-2, however in that case, this PR looks fine.

@rsn8887 rsn8887 changed the title KEYMAPPER: Fix virtual mouse bound in small rectangle in VKBD (Do not merge yet) KEYMAPPER: Fix virtual mouse bound in small rectangle in VKBD Sep 14, 2020
@rsn8887
Copy link
Contributor Author

rsn8887 commented Sep 14, 2020

I will simplify this PR once PR #2464 is merged.

@rsn8887 rsn8887 force-pushed the rsn8887:vkeybdfix branch from eb0c6d2 to 9558d37 Sep 15, 2020
@rsn8887
Copy link
Contributor Author

rsn8887 commented Sep 15, 2020

Ok it works now, very simple. Thanks @ccawley2011 !

@rsn8887 rsn8887 merged commit 3a5690e into scummvm:master Sep 15, 2020
4 of 5 checks passed
4 of 5 checks passed
Windows (win32, x86-windows, x86, --enable-faad --enable-mpeg2 --enable-discord --disable-fribidi...
Details
Windows (x64, x64, x64-windows, --enable-faad --enable-mpeg2 --enable-discord --disable-fribidi, ...
Details
Windows (arm64, arm64, arm64-windows, --enable-faad --enable-mpeg2 --enable-discord --disable-fri...
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
deepcode-ci-bot Well done, no issues found!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.