p-sprint (psp keyboard emu)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Post by seventoes »

Yeah, very steep learning curve...

Maybe i should switch my project over to a typing program for p-sprint? That would help people :D
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

seventoes wrote:Yeah, very steep learning curve...

Maybe i should switch my project over to a typing program for p-sprint? That would help people :D
That would definitely be awesome ... That's on my to do list but I haven't gotten to it yet at all. It's scrambling for time for me until 1 november at least ...
Jangie
Posts: 2
Joined: Sat Nov 05, 2005 5:02 am

integration

Post by Jangie »

I'm currently working on an application which would benefit from p-sprint, and I'm having a bit of trouble making things work correctly. I currently have a while(1) loop (great code design, eh?) that does all of the basic work that my application needs. However, just calling

Code: Select all

                p_spReadKey(&myKey);
                if(myKey.keychar!=0)
                {
                          pspDebugScreenPutChar(50, 50, 0x0FF00FFF, myKey.keychar);
                }
in my application seems to work extremely sporadically. I believe this is due to the fact that the rest of the contents of the loop take too long to execute (poor programming is to blame here...)

I was able to get it to work reliably at one point by looping the above code for a few iterations, but that takes away from the responsiveness of the rest of the program. What's the best way to use your code?

Thanks,
Jangie

PS: Forgot to specify that I'm using the most recent code as available from the first post in this thread. thanks!
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Re: integration

Post by Arwin »

Jangie wrote:I'm currently working on an application which would benefit from p-sprint, and I'm having a bit of trouble making things work correctly. I currently have a while(1) loop (great code design, eh?) that does all of the basic work that my application needs. However, just calling

Code: Select all

                p_spReadKey(&myKey);
                if(myKey.keychar!=0)
                {
                          pspDebugScreenPutChar(50, 50, 0x0FF00FFF, myKey.keychar);
                }
in my application seems to work extremely sporadically. I believe this is due to the fact that the rest of the contents of the loop take too long to execute (poor programming is to blame here...)

I was able to get it to work reliably at one point by looping the above code for a few iterations, but that takes away from the responsiveness of the rest of the program. What's the best way to use your code?

Thanks,
Jangie

PS: Forgot to specify that I'm using the most recent code as available from the first post in this thread. thanks!
Could I see the rest of the loop that you have this in? Out of the blue, I think you want to use the p_spReadKeyEx routine ... Also, just to be safe I would use >0 rather than !=0.
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

Thanks for this awesome input code Arwin.

Its been great for the telnet client I've been writing :)

Danzel.

Edit: the keyboard picture on your site has an error.
http://www.niwra.nl/psp/p-sprint-c/doc/ ... _black.gif
The X key appears to be 'Square Up', buts its actually 'Up Square'.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

danzel wrote:Edit: the keyboard picture on your site has an error.
http://www.niwra.nl/psp/p-sprint-c/doc/ ... _black.gif
The X key appears to be 'Square Up', buts its actually 'Up Square'.
Thanks! I'll fix that.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

danzel wrote:Thanks for this awesome input code Arwin.

Its been great for the telnet client I've been writing :)

Danzel.

Edit: the keyboard picture on your site has an error.
http://www.niwra.nl/psp/p-sprint-c/doc/ ... _black.gif
The X key appears to be 'Square Up', buts its actually 'Up Square'.
I just got around to testing your application. Nice :) Took me a while before I got a working MUD connection, but after a while I got one, although it was a beta. But it worked, and I like how you used p-sprint in it, works really well.
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

Another one ;)

the keys for 9 and 8 are the opposite of what it says in the picture.

Danzel.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

P-sprint has now been ported to Lua:

http://forums.ps2dev.org/viewtopic.php?t=4626
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

Arwin wrote:P-sprint has now been ported to Lua:

http://forums.ps2dev.org/viewtopic.php?t=4626
People have been asking for a keyboard input for my URL2PSP app. Any idea on when you might have C libraries available, if ever?

David Beyer
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

dbeyer3069 wrote:
Arwin wrote:P-sprint has now been ported to Lua:

http://forums.ps2dev.org/viewtopic.php?t=4626
People have been asking for a keyboard input for my URL2PSP app. Any idea on when you might have C libraries available, if ever?

David Beyer
I don't quite understand the question - c libraries have been available for a very long time! :) Just check the first post for a link to a rar with the includes and an example of how to use them.
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

Arwin wrote:
dbeyer3069 wrote:
Arwin wrote:P-sprint has now been ported to Lua:

http://forums.ps2dev.org/viewtopic.php?t=4626
People have been asking for a keyboard input for my URL2PSP app. Any idea on when you might have C libraries available, if ever?

David Beyer
I don't quite understand the question - c libraries have been available for a very long time! :) Just check the first post for a link to a rar with the includes and an example of how to use them.
OOPS. Sorry. Someone told me about p-sprint and I saw the last message about the lua and assumed that was what the other app was written in. My goof. I will check it out, thanks.

David Beyer
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

No problem! Good luck, and if you have any questions, I'm right here ... :)
jonty_rocks3
Posts: 4
Joined: Sun Oct 08, 2006 4:17 am

Post by jonty_rocks3 »

is there a pagedown key?
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

jonty_rocks3 wrote:is there a pagedown key?
Yep ...
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Arwin wrote:
jonty_rocks3 wrote:is there a pagedown key?
Yep ...
And check this page, the group 3 map and keycodes

http://www.niwra.nl/psp/p-sprint-c/doc/index.htm
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

I can't believe it, but I"ve actually worked on this yesterday ... :D. In the dosbox thread, RyTracer made the following suggestion for a new layout:

Code: Select all

Buttons     Base Group     Group 1 via L+X     Group 2 via U+X
Start       Enter 43       Enter 43            Enter 43
Select      Escape 110     PauseBreak 126      Escape 110
D           Backspace 15   Delete 76           Backspace 15
X           Space 61       Space 61            Space 61
L,L         aA 31          ,< 53               CapsLock 30
L,U         bB 50          .> 54               NumLock 90
L,R         cC 48          ;&#58; 40               NumPad/ 95
L,S         dD 33          '" 41               NumPad* 100
L,T         eE 19          &#91;&#123; 27               NumPad- 105
L,C         fF 34          &#93;&#125; 28               NumPad+ 106
U,L         gG 35          /? 55               Insert 75
U,U         hH 36          \| 29               Delete 76
U,R         iI 24          `~ 1                Home 80
U,S         jJ 37          -_ 12               End 81
U,T         kK 38          =+ 13               PgUp 85
U,C         lL 39          Tab 16              PgDn 86
R,L         mM 52          F1 112              LCtrl 58
R,U         nN 51          F2 113              LShift 44
R,R         oO 25          F3 114              LAlt 60
R,S         pP 26          F4 115              RAlt 62
R,T         qQ 17          F5 116              RShift 57
R,C         rR 20          F6 117              RCtrl 64
S,L         sS 32          F7 118              PrntScrnSysRq 124
S,U         tT 21          F8 119              ScrollLock 125
S,R         uU 23          F9 120              PauseBreak 126
S,S         vV 49          F10 121             LWin 127
S,T         wW 18          F11 122             RWin 128
S,C         xX 47          F12 123             Menu 129
T,L         yY 22          NumPadEnter 108     Left 79
T,U         zZ 46          NumPad.Del 104      Up 83
T,R         1! 2           NumPad1End 93       Right 89
T,S         2@ 3           NumPad2Down 98      Down 84
T,T         3# 4           NumPad3PgDn 103
T,C         4$ 5           NumPad4Left 92
C,L         5% 6           NumPad5 97
C,U         6^ 7           NumPad6Right 102
C,R         7& 8           NumPad7Home 91
C,S         8* 9           NumPad8Up 96
C,T         9&#40; 10          NumPad9PgUp 101
C,C         0&#41; 11          NumPad0Ins 99
I've made a beta release which implements this, which you can download here. It contains the test application as well as the p-sprint.c and p-sprint.h libraries that applications using p-sprint typically include. Everything should still be pretty much compatible, but this new layout is a lot easier to memorise.

http://www.niwra.nl/psp/p-sprint-c/p-sprint-c-070b.zip

(note: it still says 62/3a here and there, but I can't log-on to the ftp server at the moment to upload a version where I've edited that, so ignore this for the moment)

Thanks to RyTracer for the very good idea, it works really well - typing and memorising is surprisingly easy now. I think if I find the time I"ll try my gllighttext project and combine it with p-sprint to make some kind of fun typing trainer with scores and such. ;)

Should you have any input on the new layout, have any suggestions or other requests, just let me know!
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

I managed 9,5 words per minute in a small little test, which I then repeated on the PC where I got 101 words per minute (ten fingers, blind).

The keys on the PSP aren't as good as the ones on a regular keyboard so I don't think I can manage 50 words per minute on it, but that would theoretically be my maximum speed on this system- you only ever need to really press 2 buttons for every one character most of the time, and all the more complicated keys are compensated for by space and backspace (and return) being just one key.
Post Reply