Skip to content

Add support for systems without mouse or keyboard#26

Open
Nawias wants to merge 1 commit into
tesselode:masterfrom
Nawias:patch-1
Open

Add support for systems without mouse or keyboard#26
Nawias wants to merge 1 commit into
tesselode:masterfrom
Nawias:patch-1

Conversation

@Nawias

@Nawias Nawias commented Nov 18, 2022

Copy link
Copy Markdown

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
Copy Markdown
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

Nawias commented Nov 25, 2022

Copy link
Copy Markdown
Author

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

@Nawias

Nawias commented Nov 25, 2022

Copy link
Copy Markdown
Author

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
Copy Markdown
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

Nawias commented Nov 26, 2022

Copy link
Copy Markdown
Author

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