onscreen configurable lua keyboard (test version)

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
liquid8d
Posts: 66
Joined: Thu Jun 30, 2005 6:29 am

onscreen configurable lua keyboard (test version)

Post by liquid8d »

Hello,

Been playing around quite a bit and I love this. Here is my first test project.

Image

http://www.atgig.com/liquid8d/index.html

I have been painstakingly using pspad to write some of the scripting, and while the program itself could use some work, I LOVE the circular keypad input.. it's very quick to pick up on and easy to type.

The one problem I had was it was a bit too sensitive as there were 26 buttons all the way around the analog, which gave little room for error.

I started working on this as I would need some keyboard input for some stuff I will be working on soon, and thought it would be nice to throw it out there. The setup now is a 32 key + Main button. This setup is a bit touchy, but I am still fine tuning it.


---------------------------------------------------
This is the first test version, but in my future releases, I intend to do the following:

- additional key sets, including special keys (say like 5 sets for alpha lower/upper, numbers, etc)

- Add selectable keyboard/mapping : This will allow you to pick from various keyboard setups, and keep your own customizable mapping saved in a seperate folder for say.. common programming layout, that can be used from lua program to lua program (assuming it is using this keyboard script)

- Add macro support (so you can have macros for say lua if/while/etc statements)

- Add a few more keyboards

- More customization

- Make more "script friendly": you will be able to call say.. getInput() to get a line from the user, or getKeyInput() to return each key pressed, isVisible() to know if it is visible or not, etc...
---------------------------------------------------

If someone would like to play around and create your own you can, just name your images to "pad.png" for the keyboard bg and "sel.png" for the 'hover' pictures. Then check out the keyboard.lua for the key setup.. it takes a bit of work to setup, but you can literally make your keyboard look however you want. Here's what's configurable for each key:

char = the character to show/input

loc x,y = the top/left location of the selected key image from the topleft of the background image

color = the color the character shown on the key will turn when selected

offset x,y = the offset from the topleft of the selected key image to display the character

imgindex = topleft location of the image to use in the sel.png image

imgsize width,height = the size of the image to use in sel.png

!!NOTE: these range from 0-254 to avoid negative values, 0 being the top and left of the analog respectively

analogmin x,y = minimum range for the analog to select the key
analogmax x,y = maximum range for the analog to select the key

I would love to make this real nice and see it implemented in some lua programs! Please feel free to leave your suggestions or pm me with them.


LiQuiD8d
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

very nice idea..
Chaosmachine Studios: High Quality Homebrew.
nevyn
Posts: 136
Joined: Sun Jul 31, 2005 5:05 pm
Location: Sweden
Contact:

Post by nevyn »

Awesome! I've been hoping someone would do a text input with the analog stick...

It IS faster than Haggar's Notepad input, but it hurts my thumb badly... Wrote just "Hello world" and now my thumb aches. Something that needs less precision would be nice...

I saw an idea somewhere else on the ps2dev forums, using the analog stick to select a /group/, from which you then selected character with the triangle, circle, x and square buttons.

Image
Here's an example picture of what I mean. I added a center group (which is selected when the analog stick is in neutral position) which could be used for changing between letters and numbers, and space and backspace. Using L could be used as a shift key...

What do you think?
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

nevyn wrote:Image
Here's an example picture of what I mean. I added a center group (which is selected when the analog stick is in neutral position) which could be used for changing between letters and numbers, and space and backspace. Using L could be used as a shift key...

What do you think?
If you think about it, your concept is very similar to providing a graphical interface to p-sprint. P-sprint has six + 2 main buttons, and 6 more combinations following from the first 6 buttons. Once the new version of Lua is out I'll try to think up a nice graphical interface for it. Of course I'd gladly cooperate with anyone else also, if they have a better graphical system we could always make a library that offers both at the same time where feasible, or just the one or the other if the situation dictates it. I would recommend making the graphical user interface opaque with alpha-blending so that it doesn't block the original application fully and can be used under most circumstances.
MikeHaggar
Posts: 116
Joined: Mon Jul 18, 2005 2:20 am

Post by MikeHaggar »

nevyn wrote:It IS faster than Haggar's Notepad input, but it hurts my thumb badly... Wrote just "Hello world" and now my thumb aches. Something that needs less precision would be nice...
Err... Haggar's Notepad input?

rob_psp made Notepad... not me...
liquid8d
Posts: 66
Joined: Thu Jun 30, 2005 6:29 am

Post by liquid8d »

oh my god! why does phpBB not save a message when you timeout and have to log back in ...

heh.. Haggar did the text reader I believe?? :)

I agree that the current configuration can be a bit painful on the thumb. I am working on adjusting this. I thought about maybe if you hold a single key (say L) then it only goes around the inner rows, otherwise it goes around the outer rows.

I agree that your setup is similar to what psprint would (and should) look like graphically. I prefer to not use button combinations for keys, as it makes it more complex. On the flip side, once you can remember the presses, it has the bonus of you being able to type without looking at anything. I think this is what Arwin is going for. I believe that both need to be available, so beginner and advanced users can make use of it.

Arwin, you are really pushing that psprint aren't you? :) just messin' with ya, I and others appreciate the hard work you are putting into it, and I agree once there is a graphical implementation, it will be great. Right now, though, it is just too complex for ordinary users. Maybe we can get together on some sort of combination of the two.

Like I said, the actual layout and setup is (and/or will be) very configurable. I intend to also include d-pad control and not just analog. As soon as I setup multiple key pages/sets it will be easier to play around with.
MikeHaggar
Posts: 116
Joined: Mon Jul 18, 2005 2:20 am

Post by MikeHaggar »

liquid8d wrote:heh.. Haggar did the text reader I believe?? :)
yup, that I did ;)
MikeHaggar
Posts: 116
Joined: Mon Jul 18, 2005 2:20 am

Post by MikeHaggar »

Anybody tried XPad on the Xbox? It got a nice analogue input system... Although it would be hard to do on the PSP. :P
nevyn
Posts: 136
Joined: Sun Jul 31, 2005 5:05 pm
Location: Sweden
Contact:

Post by nevyn »

MikeHaggar wrote:
nevyn wrote:It IS faster than Haggar's Notepad input, but it hurts my thumb badly... Wrote just "Hello world" and now my thumb aches. Something that needs less precision would be nice...
Err... Haggar's Notepad input?

rob_psp made Notepad... not me...
Huh! I was *certain* that you wrote it. Hm, must've read too fast... Sorry.


I second the point about the complexity of psprint, I never actually understood how to work it. :/ (not that I gave it much of a chance)
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

liquid8d wrote:Arwin, you are really pushing that psprint aren't you? :) just messin' with ya, I and others appreciate the hard work you are putting into it, and I agree once there is a graphical implementation, it will be great. Right now, though, it is just too complex for ordinary users. Maybe we can get together on some sort of combination of the two.
I am, and its getting embarrassing, I know. But I was playing a text adventure on dosbox today (and lots of stuff like that, but little more glorious than the text adventure that gave birth to Leisure Suit Larry ;) ) and realised again that it really seems the way to go. There's room for all sorts of stuff to make life easier in specific situations by allowing for custom dictionaries and shortcuts for words, like you suggested for lua, but first things first.

I would really like to join efforts on this, as a standard approach would really help everyone - people won't have to waste time on inventing the wheel again and again. Do you know how many different implementations there already are? I counted - what - 10 ... ?. :D

@nevyn et al.: give it a shot, it's really not that hard. The buttons have a layout that does, in fact, make sense and isn't that hard to remember. It's nowhere near as hard as, say, mastering all Nina's moves in Tekken or anything, yet billions of people at least try that. :D

And once you're chatting on the PSP, do you really want to use a lot of your precious screen space to an OSK?

But of course we also need a good, fast, easy to use osk.

If you make a mapping, you could easily use the same keyid system as p-sprint, and make it use the same library interface. That would be a great start. That way, coders can easily implement either system, and even offer the user an option to switch between systems.
Post Reply