Looking in the wiki it seems that '!' is a valid key. But on my UK keyboard you write it with shift+1 but it comes through to love.keypressed() as 1. Also love.keyboard.isDown('!') won't trigger.
I could make a table of shifted keys but it's not the same for all countries, e.g. quote and double quote are different between UK and US keyboards and I have no way to detect the locale of the user.
Is there a standard way to deal with this sort of thing in Love? Should I just steer clear of symbol keys?
Can't get shift+key symbols to work.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Can't get shift+key symbols to work.
Typically, you use the unicode argument to love.keypressed. As for why? Well, the key actually being depressed is the 1 key, the unicode character generated is the exclamation mark, there is a difference between those two things.
Re: Can't get shift+key symbols to work.
I totally missed the unicode argument to love.keypressed(). Thanks for that!
Who is online
Users browsing this forum: MrFariator and 2 guests