Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Johnny 5 beta 2.0 released!  (Read 17956 times)

0 Members and 1 Guest are viewing this topic.

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re: Johnny 5 beta 2.0 released!
« Reply #40 on: October 19, 2005, 11:02:36 am »
I've though about asking on the AHK support list, but I'm not sure how to characterize the problem to ask the question properly.
What do we believe the problem is exactly?

My own experimentation a week or two ago seemed to show that MAME was not getting the unpause key, or possibly was getting two of them in very fat succession (on the pacman startup screen I would see the test pattern change one step).
I added a 3s delay between the time we tell johnny to exit and MAME to unpause, so I thought the problem couldn't be with johnny, but if you say it works when calling irfanview or cpviewer in the scrips, then maybe I need to rethink my original conclusion.

I'll try and play with it more this weekend.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Johnny 5 beta 2.0 released!
« Reply #41 on: October 19, 2005, 11:21:39 am »
I've though about asking on the AHK support list, but I'm not sure how to characterize the problem to ask the question properly.
What do we believe the problem is exactly?
As I see it, we have 3 problems:

1)  Script does not pause with MAME in Win98.  (Possibly keyhook problem, but odd because script does work correctly in Win98 if you simply load it and try to launch Johnny from an application other than MAME.

2) Unmodified script (Method 4) gets confused when pausing and unpausing MAME.

3) Modified script (Method 5) is always active and should be only active with MAME paused, you posted earlier about this.  We need a way for the script to monitor whether MAME is running or paused . . .
Quote
My own experimentation a week or two ago seemed to show that MAME was not getting the unpause key, or possibly was getting two of them in very fat succession (on the pacman startup screen I would see the test pattern change one step).
My tests seemed to reflect that also . . .
Quote
but if you say it works when calling rfanview or cpviewer in the scrips, then maybe I need to rethink my original conclusion.
That was NOT what I said.  What I said was Method 5 (launch from a separate Hotkey after MAME is paused) worked when calling IrfanView and was faster than calling Johnny5.  Therefore, possibly it would be less problematic to call Irfanview than Johnny5 when MAME was paused (Method 4), but I did NOT test this out.
Quote
I'll try and play with it more this weekend.
Thanks
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

AllisterFiend

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 165
  • Last login:June 04, 2013, 05:04:16 am
  • Rush 2112
    • Check out my Dragon's Lair/MAME cabinet.
Re: Johnny 5 beta 2.0 released!
« Reply #42 on: October 19, 2005, 06:29:31 pm »
I've though about asking on the AHK support list, but I'm not sure how to characterize the problem to ask the question properly.
What do we believe the problem is exactly?
As I see it, we have 3 problems:

1)  Script does not pause with MAME in Win98.  (Possibly keyhook problem, but odd because script does work correctly in Win98 if you simply load it and try to launch Johnny from an application other than MAME.

2) Unmodified script (Method 4) gets confused when pausing and unpausing MAME.

3) Modified script (Method 5) is always active and should be only active with MAME paused, you posted earlier about this.  We need a way for the script to monitor whether MAME is running or paused . . .
Quote
My own experimentation a week or two ago seemed to show that MAME was not getting the unpause key, or possibly was getting two of them in very fat succession (on the pacman startup screen I would see the test pattern change one step).
My tests seemed to reflect that also . . .
Quote
but if you say it works when calling rfanview or cpviewer in the scrips, then maybe I need to rethink my original conclusion.
That was NOT what I said.  What I said was Method 5 (launch from a separate Hotkey after MAME is paused) worked when calling IrfanView and was faster than calling Johnny5.  Therefore, possibly it would be less problematic to call Irfanview than Johnny5 when MAME was paused (Method 4), but I did NOT test this out.
Quote
I'll try and play with it more this weekend.
Thanks

  I posted a message on AHK forum last night. (papaschtroumpf, I just saw your post on their forum also), but mine was concerning problem #3.

  Thalon from the AHK forum posted a solution to problem #3 and so far it has been working for me, I'll list it here so someone else can test it out also.  I had to remove a line and add an } in his solution to get it to work. (I do not think it needed that line, oh well, it started to work when it was removed ;D)

  Okay, lets see if I can get this to list okay...

  This is what Thalon posted.

Code: [Select]
~p::
IfWinActive, ahk_class {M.A.M.E.class}
{
   if p_pressed = 1
     p_pressed = 0
   else
     p_pressed = 1
}
return

~7::
{
   if p_pressed = 1
   {
      If ScreenState =1
      {
         send, {Escape down}
         send, {Escape up}
......
      }
   }
return

  And this is how It looks in the script that I am using.

Code: [Select]
#SingleInstance force
#Persistent
; The asterisk prefix makes the remapping more complete on XP/2k/NT. For 9x systems you can remove it.
DetectHiddenWindows, On
ScreenState=0
~p::
{
   if p_pressed = 1
     p_pressed = 0
   else
     p_pressed = 1
}
return

~7::
{
   if p_pressed = 1
   {
If ScreenState = 1
{
send, {Escape down}
send, {Escape up}
WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
ScreenState=0
}
else
{
WinGetActiveTitle, Title
J5=i_view32.exe %1%.png /fs
Run,%J5%, L:\arcademachine\mame\arcadecabinetcontrols, max
ScreenState=1
}
   }
}
return
~Escape::
{
If ScreenState = 1
{
WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
ScreenState=0
}
}
return
~=::
if ScreenState=1
{
send, {Escape down}
send, {Escape up}
WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
ScreenState=0
}
else
{
ExitApp ; Assign a hotkey to terminate this script.
}
return

Let me know how this works for you.

Here are the links to the two messages on the AHK forums...

http://www.autohotkey.com/forum/viewtopic.php?p=35492#35492
http://www.autohotkey.com/forum/viewtopic.php?t=5915

Thanks,

Allister Fiend

bigfuz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 51
  • Last login:December 06, 2005, 10:26:18 pm
  • Not quite as hairy...
Re: Johnny 5 beta 2.0 released!
« Reply #43 on: October 20, 2005, 05:40:31 pm »
Tiger-Heli, whats the reason behind the "Win98SE does not work (and likely will not ever)" for AHK?
« Last Edit: October 20, 2005, 07:35:43 pm by bigfuz »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Online Online
  • Posts: 19427
  • Last login:Today at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny 5 beta 2.0 released!
« Reply #44 on: October 20, 2005, 08:34:15 pm »
It's a limitation of windows 98.  98 doesn't allow high-level hooking of the keyboard.  While it possibly could be done at a very low level, it'd screw up the inputs in mame and virtually everything else.  Long story short, it *may* be possible, but not with ahk or any of the wrappers I make and not easily. 

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Johnny 5 beta 2.0 released!
« Reply #45 on: October 22, 2005, 07:42:19 am »
AllisterFiend - Great find - I updated http://www.mameworld.net/tigerheli/johnny/ahk_th.htm to reflect your method.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

diabolic

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 42
  • Last login:August 26, 2007, 02:36:22 pm
Re: Johnny 5 beta 2.0 released!
« Reply #46 on: October 22, 2005, 12:59:12 pm »

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Johnny 5 beta 2.0 released!
« Reply #47 on: October 22, 2005, 01:03:50 pm »
I had to add a } to the script for method 5 to work for me.
Is it wrong on my page?

Where did you add it?
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

diabolic

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 42
  • Last login:August 26, 2007, 02:36:22 pm
Re: Johnny 5 beta 2.0 released!
« Reply #48 on: October 22, 2005, 01:14:28 pm »
Is it wrong on my page?

Where did you add it?

Actually I added { and }.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Online Online
  • Posts: 19427
  • Last login:Today at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny 5 beta 2.0 released!
« Reply #49 on: October 23, 2005, 02:50:35 am »
Just to go over the ahk limitations discussion.....

It is indeed a 98 problem.  9X handles low level input differently than a NT based environment does.  The reason notepad and more "windowsey" apps aren't affected is because they only use high level input scanning and don't hook the keyboard buffer.   Basically anything running direct input in exclusive mode, allegro's input system or anything similar isn't going to work. (Read 99% of all emulators.) Apps coded in visual studio languages (like notepad and many of the apps that come with windows) will.  Daphne probably has about a 50/50 shot in 98 as sdl seems to be less picky.  Some of the console emulators support sdl input plugins so that might be a solution for them.  Otherwise, you are sol.

You'll notice that j5 detects the inputs in 98 as well.  That's because I used vb6 to code it and I don't use any fancy hooking methods.