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: Emulating keyboard keys while in MAME?  (Read 4998 times)

0 Members and 1 Guest are viewing this topic.

DinoRoger

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 139
  • Last login:October 24, 2005, 02:00:37 am
  • Hey, can I borrow a quarter?
Emulating keyboard keys while in MAME?
« on: May 14, 2003, 12:17:15 am »
When I press a certain key on the keyboard a macro is ran that will emulate keys being pressed.  Outide MAME it works without any problems.  When I am in a MAME game though the macro launches and runs but the keys are not emulated???  I can press they key for example 5 times and when I exit MAME I can see it actualy ran the macro all 5 times but its like MAME is blocking the keys.  from outside progams.  Anyone ever tinker with this or know a solution?

BobA

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5943
  • Last login:July 11, 2018, 09:52:14 pm
  • What Me Worry?
Re:Emulating keyboard keys while in MAME?
« Reply #1 on: May 14, 2003, 12:25:32 am »
The AOS doc had a very confusing bit about keyboard remapping and the difficulties.  I wonder if it would be relevant to what you are experiencing?

Just a shot in the dark on my part.

BobA
« Last Edit: May 14, 2003, 12:27:00 am by BobA »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:July 13, 2025, 11:38:27 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Emulating keyboard keys while in MAME?
« Reply #2 on: May 14, 2003, 12:38:21 am »
Mame uses direct input.... in other words other programs can see the keys, but it's extremely difficult (practically impossible) to send keys to mame.  Sorry man but your out of luck.  

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:Emulating keyboard keys while in MAME?
« Reply #3 on: May 14, 2003, 12:40:44 am »
If you're using win mame (or mame32), mame looks at the keyboard input through directX.  Not through the normal win32, event based, method.

Do you know if the macro outputs the keypresses as a simulated keyboard device (directX should see this), or does it output them as "windows events" (ie: inserted after directX in the input data stream, so mame wouldn't see them).  My guess is it's the latter.
Robin
Knowledge is Power

TheTick

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 411
  • Last login:December 21, 2009, 12:24:27 pm
  • I.P. Daley
Re:Emulating keyboard keys while in MAME?
« Reply #4 on: May 14, 2003, 10:56:00 am »
1) Modify \src\windows\input.c
    Have your external app call a modified function in MAME that inserts the keystrokes directly into MAME's keyboard handler. i.e. win_poll_input() , keyboard_state[]

Best Way Better than the previous way
2) Code a wrapper for directX.
   Mame calls directX.directInput but is actually talking to your app. All calls are passed on, except when you want to insert some keypresses of your own.
« Last Edit: May 14, 2003, 11:03:16 am by TheTick »
Mucal invader, is there no end to your oozing?!