| View previous topic :: View next topic |
| Author |
Message |
Tsukasa
Joined: 04 Jul 2005 Posts: 12
|
Posted: Thu May 11, 2006 5:46 am Post subject: Press a key without pressing it |
|
|
Hi
I've a simple question:
Is it possible to code a program which is able to press automatically a predefined button in a certain time?
Thanks in advance |
|
| Back to top |
|
 |
lS[UMD/2kdlSU]
Joined: 26 Oct 2005 Posts: 8 Location: Shiga, Japan
|
Posted: Fri May 12, 2006 9:08 am Post subject: Re: Press a key without pressing it |
|
|
| Tsukasa wrote: | Hi
I've a simple question:
Is it possible to code a program which is able to press automatically a predefined button in a certain time?
Thanks in advance |
Possible :)
You have to patch the sceCtrl**** stub(if you want to take a effect to a module)
or function body(if you want to take a effect to all modules).
I've tried patching sceCtrlReadBufferPositive stub in "game" module and it worked:)
| Code: |
// The part of the test code
PspCtrlButtons mask_and;
PspCtrlButtons mask_or;
int patched_sceCtrlReadBufferPositive(SceCtrlData *pad_data, int count)
{
int result = sceCtrlReadBufferPositive(pad_data, count);
pad->Buttons &= mask_and;
pad->Buttons |= mask_or;
return result;
}
|
_________________ lS[UMD/2kdlSU] - now working as 67...
----------------------------------------------
site: jap | eng
jap blog: here |
|
| Back to top |
|
 |
pipspsp
Joined: 13 May 2006 Posts: 4
|
Posted: Sat May 13, 2006 1:49 am Post subject: |
|
|
im not a c coder, but shouldn't you use the function that the button executes?
if (pad.Buttons & PSP_CTRL_SQUARE){
printf("Square pressed \n");
}
couldn't you just change the if
if ("time" = "when i want it"){
printf("Square pressed \n");
} |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sat May 13, 2006 1:56 am Post subject: |
|
|
| pipspsp wrote: | im not a c coder, but shouldn't you use the function that the button executes?
if (pad.Buttons & PSP_CTRL_SQUARE){
printf("Square pressed \n");
}
couldn't you just change the if
if ("time" = "when i want it"){
printf("Square pressed \n");
} |
But maybe he is running code in the background and wants to generate the press for a another program. |
|
| Back to top |
|
 |
Drakonite Site Admin

Joined: 17 Jan 2004 Posts: 989
|
Posted: Sat May 13, 2006 8:37 am Post subject: |
|
|
What possible use could this have? _________________ Shoot Pixels Not People!
Makeshift Development |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Sat May 13, 2006 9:07 am Post subject: |
|
|
err why not just skip the controller input for function
for using the function you want at a given time
to execute at that time ...controller input is after all
just input to another function :P _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sat May 13, 2006 9:13 am Post subject: |
|
|
| Drakonite wrote: | | What possible use could this have? |
I'm not him, but maybe he wants to generate events for another program, or for a game, maybe a list of events in specific times to automatize some things.
Another possible use of this would be something like VNC, but at the contrary: controlling the psp with a computer or with another psp. |
|
| Back to top |
|
 |
Drakonite Site Admin

Joined: 17 Jan 2004 Posts: 989
|
Posted: Sat May 13, 2006 9:55 am Post subject: |
|
|
| moonlight wrote: |
I'm not him, but maybe he wants to generate events for another program, or for a game, maybe a list of events in specific times to automatize some things.
|
...and we don't hack official games here. _________________ Shoot Pixels Not People!
Makeshift Development |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sat May 13, 2006 1:45 pm Post subject: |
|
|
| Drakonite wrote: | | moonlight wrote: |
I'm not him, but maybe he wants to generate events for another program, or for a game, maybe a list of events in specific times to automatize some things.
|
...and we don't hack official games here. |
I didn't mention the word official, it can be whatever game ;) |
|
| Back to top |
|
 |
Drakonite Site Admin

Joined: 17 Jan 2004 Posts: 989
|
Posted: Sat May 13, 2006 3:40 pm Post subject: |
|
|
| moonlight wrote: | | Drakonite wrote: | | moonlight wrote: |
I'm not him, but maybe he wants to generate events for another program, or for a game, maybe a list of events in specific times to automatize some things.
|
...and we don't hack official games here. |
I didn't mention the word official, it can be whatever game ;) |
Thats still not really within our rules... If it's your game, you don't need to fake button presses like this.. and if it's someone elses, we really don't hack games like that here. _________________ Shoot Pixels Not People!
Makeshift Development |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sat May 13, 2006 4:22 pm Post subject: |
|
|
| Drakonite wrote: | | moonlight wrote: | | Drakonite wrote: | | moonlight wrote: |
I'm not him, but maybe he wants to generate events for another program, or for a game, maybe a list of events in specific times to automatize some things.
|
...and we don't hack official games here. |
I didn't mention the word official, it can be whatever game ;) |
Thats still not really within our rules... If it's your game, you don't need to fake button presses like this.. and if it's someone elses, we really don't hack games like that here. |
But still can be used for other things.
For example the psp vnc server concept. Useful? Probably not, but like a curiosity or proof of concept is right. |
|
| Back to top |
|
 |
Devun_06
Joined: 17 Jun 2006 Posts: 15
|
Posted: Sun Jun 18, 2006 10:49 am Post subject: |
|
|
| Well, I'd love to see how this is done, simply because it's the only way I see a program being able to turn off the PSP's screen and I want to introduce a nice sleep feature within my own program/eboot. |
|
| Back to top |
|
 |
Zettablade
Joined: 05 May 2006 Posts: 71
|
Posted: Sun Jun 18, 2006 5:23 pm Post subject: |
|
|
| Same here. So, uh, well? What is the code! lol sorry. I've been wanting to know all day... |
|
| Back to top |
|
 |
vista200
Joined: 19 Mar 2008 Posts: 13
|
Posted: Fri Mar 21, 2008 7:53 pm Post subject: Maybe a little late, but... |
|
|
I tried some ways and i found a solution:
You just have to add the PSP_CTRL_XXXXX to pad.Buttons like here:
| Code: | SceCtrlData pad;
while (1)
{
sceCtrlReadBufferPositive(&pad, 1);
pspDebugScreenSetXY(0, 0);
printf("%i\n", pad.Buttons); // standard pad, nothing pressed
pad.Buttons = pad.Buttons + PSP_CTRL_CROSS;
printf("%i\n", pad.Buttons); // changed pad, where CROSS is pressed
if (pad.Buttons & PSP_CTRL_CROSS) { printf("X is pressed!\n"); }
} |
and tada, you see the message, that CROSS is pressed!
It works for me on 3.90 M33-2 with 1.50 Kernel
This is very useful when remote controlling the psp's music player! You just add your codes of your remote control and then switch songs with the remote.
Thus far from my side,
vista200 |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Fri Mar 21, 2008 8:34 pm Post subject: |
|
|
| Did you resume such an old post to say such wrong things?? Once you get pad data structure, that is YOUR LOCAL COPY of a system struct, not the struct itself....if you modify it in your code, then your code is the scope of your variable, and other processes CANNOT see the change: you definitely cannot drive the xmb mp3 player with this nonsense...local and global scopes:things i learned in a BASICA course when i was eight. |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sat Mar 22, 2008 4:19 am Post subject: |
|
|
XmbController :D, LocoRoco motion :D, vshanalog, JoySens, RemoteJoy, etc _________________ Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Sat Mar 22, 2008 4:56 am Post subject: |
|
|
| KickinAezz wrote: | | XmbController :D, LocoRoco motion :D, vshanalog, JoySens, RemoteJoy, etc |
Ok, but none of these are made with that crappy code...they do it hooking sys function calls...i guess piKey sources are a good place to start learning how to do such a thing.....IF you can already code c and distinguish between local/global/process/system scopes. |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sat Mar 22, 2008 6:36 am Post subject: |
|
|
| jean wrote: | | KickinAezz wrote: | | XmbController :D, LocoRoco motion :D, vshanalog, JoySens, RemoteJoy, etc |
Ok, but none of these are made with that crappy code...they do it hooking sys function calls...i guess piKey sources are a good place to start learning how to do such a thing.....IF you can already code c and distinguish between local/global/process/system scopes. | Ofcourse! First two seem familiar to me, cuz they're are mine ;) _________________ Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Sat Mar 22, 2008 10:33 am Post subject: |
|
|
@KickinAezz
Oh, sorry i didn't know :)))) ....greetings for those good pieces of software...oh, and by "IF you can already code ..." i did not mean YOU, of course
hi! |
|
| Back to top |
|
 |
Leot91

Joined: 04 Jun 2008 Posts: 6 Location: California
|
Posted: Fri Jun 06, 2008 7:55 am Post subject: |
|
|
| Drakonite wrote: | | What possible use could this have? |
I just thought of a good idea for this.
The possiblitys are endless. _________________ My current psp status
3.71 M33 - 2, w/ 1.50 patch.
Type - Fat psp fully working
Pandora batt on hand.
** Im a willing betta tester ** |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Sat Jun 07, 2008 1:46 am Post subject: |
|
|
| Quote: | | Posted: Fri May 12, 2006 11:37 pm Post subject:... |
This post is old as my grandpa's ass, and all the "endless" possiblilities have been explored...take a look to the ton of homebrew starting with pikey |
|
| Back to top |
|
 |
Mopeto
Joined: 27 Jun 2008 Posts: 1
|
Posted: Wed Jul 02, 2008 11:00 pm Post subject: |
|
|
| I dont know if this works but the pump it up zero game have "replay" function which only press the butons you did. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Wed Jul 02, 2008 11:06 pm Post subject: |
|
|
| Don't feel attacked, but....no, it's not the point. |
|
| Back to top |
|
 |
Wally

Joined: 26 Sep 2005 Posts: 672
|
Posted: Thu Jul 03, 2008 10:12 am Post subject: |
|
|
| jean wrote: | | Quote: | | Posted: Fri May 12, 2006 11:37 pm Post subject:... |
This post is old as my grandpa's ass, and all the "endless" possiblilities have been explored...take a look to the ton of homebrew starting with pikey |
Slight exaggeration there jean, or your grandpa is only two years old :) |
|
| Back to top |
|
 |
|