Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Snes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
rooski
Master Cheater
Reputation: 0

Joined: 31 Oct 2007
Posts: 340
Location: Siberia

PostPosted: Mon May 10, 2010 6:28 pm    Post subject: Snes Reply with quote

does anyone know of an snes emulator that does not use direct input? or of a way to send keystrokes to a direct input game so the character will actually move , ive been having lots of trouble with this and have had no luck .

my problem with direct input seems to be that the key down isnt being recognized/sent , but key up is , so if im playing mario and i keep sending the run key and i run right , mario will only walk , but if i myself press the runkey and run right then he runs until the key is sent by my program , then he starts just walking , telling me that a key up was sent successfully.

using this code to send
Code:
void Key ( int vk , BOOL bExtended)
{
  KEYBDINPUT  kb={0};
  INPUT    Input={0};
  // generate down
  if ( bExtended )
    kb.dwFlags  = KEYEVENTF_EXTENDEDKEY;
  kb.wVk  = vk; 
  Input.type  = INPUT_KEYBOARD;

  Input.ki  = kb;
  SendInput(1,&Input,sizeof(Input));

  // generate up
  ZeroMemory(&kb,sizeof(KEYBDINPUT));
  ZeroMemory(&Input,sizeof(INPUT));
  kb.dwFlags  =  KEYEVENTF_KEYUP;
  if ( bExtended )
    kb.dwFlags  |= KEYEVENTF_EXTENDEDKEY;

  kb.wVk    =  vk;
  Input.type  =  INPUT_KEYBOARD;
  Input.ki  =  kb;
  SendInput(1,&Input,sizeof(Input));
}

_________________
clawtheclouds.com
Back to top
View user's profile Send private message
rooski
Master Cheater
Reputation: 0

Joined: 31 Oct 2007
Posts: 340
Location: Siberia

PostPosted: Sat May 15, 2010 11:04 am    Post subject: Reply with quote

Solution, will work for any game that uses direct input.

http://www.elitepvpers.de/forum/war-hacks-bots-cheats-exploits/170258-simulating-keystrokes.html

_________________
clawtheclouds.com
Back to top
View user's profile Send private message
False Prophet
Expert Cheater
Reputation: -1

Joined: 28 May 2006
Posts: 121

PostPosted: Sun May 16, 2010 4:28 am    Post subject: Reply with quote

rooski wrote:
Solution, will work for any game that uses direct input.

http://www.elitepvpers.de/forum/war-hacks-bots-cheats-exploits/170258-simulating-keystrokes.html


SendInput is such a hassle, though. Thanks for this, the read was great.

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun May 16, 2010 5:53 pm    Post subject: Reply with quote

Why call SendInput multiple times? Just feed it your array of input and do it in one shot.

Nicer looking, easier in general
Back to top
View user's profile Send private message
rooski
Master Cheater
Reputation: 0

Joined: 31 Oct 2007
Posts: 340
Location: Siberia

PostPosted: Sun May 16, 2010 10:26 pm    Post subject: Reply with quote

slovach wrote:
Why call SendInput multiple times? Just feed it your array of input and do it in one shot.

Nicer looking, easier in general


if you needed a delay between keys .

anyways,

anyone do any programming with genetic algorithms , because i need some help/advice setting up the gene structure for one.

_________________
clawtheclouds.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites