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

Add support for systems without mouse or keyboard #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nawias
Copy link

@Nawias Nawias commented Nov 18, 2022

Added nullchecks for love.keyboard and love.mouse for forks of LOVE like LOVEPotion, where keyboard and mouse aren't handled like normal

Added nullchecks for love.keyboard and love.mouse for forks of LOVE like LOVEPotion, where keyboard and mouse aren't handled like normal
@tesselode
Copy link
Owner

Arguably, if love.keyboard and love.mouse aren't available, shouldn't we throw an error if somebody tries to use those sources instead of silently doing nothing? Unless you're trying to use the same code for multiple platforms.

@Nawias
Copy link
Author

Nawias commented Nov 25, 2022

Yeah, that's what I'm trying to do

@Nawias
Copy link
Author

Nawias commented Nov 25, 2022

I'd like to add, baton works well with lovepotion (after this nilcheck) and if my changes don't slow down the library significantly, I feel it would be a better option to have it merged rather than maintain a fork for just this purpose

@tesselode
Copy link
Owner

My concern isn't the performance, it's the silent misbehavior. Does LovePotion offer any way to tell that you're running on 3DS at runtime? Because if so, I would just use a different input config depending on the system.

@Nawias
Copy link
Author

Nawias commented Nov 26, 2022

I mean, there are some constants that tell you what console you're running on, but I don't know if "misbehaviour" is the right word. Lovepotion runs only on 3DS and Switch, none of which have a concept of mouse and keyboard, so the love.mouse and love.keyboard APIs were not fully implemented by the developer (love.keyboard is used for the system keyboard like in smartphones, I believe). So what my nilchecks do is just keep the library from crashing on those consoles, because it would just throw a lua error trying to access a method that is nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants