Author Topic: [SOLVED] Configure AM using script instead of Tab key  (Read 4871 times)

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 252
    • View Profile
    • Github Repositories
[SOLVED] Configure AM using script instead of Tab key
« on: May 30, 2017, 08:54:37 PM »
I would like to be able to pick a menu item to launch the "tab" menu, rather than having to hit the tab key itself. Why? So I don't have to have a dedicated key just for "tab" or a keyboard, and I would only like setup to launch from the setup screen itself.

So I started poking around the internet... before I go off deep in the weeds testing a bunch of stuff out, I wondered if anyone had any input on this.

I was wondering if setting the "!! Press TAB to configure AM.sh" to be a bash script with some kind of xdotools or something similar would work. I haven't poked around in the code too much yet, just wondered if someone else had already done something like this.
« Last Edit: June 03, 2017, 12:09:50 AM by mahuti »

xbs

  • Sr. Member
  • ****
  • Posts: 180
    • View Profile
Re: Configure AM using script instead of Tab key
« Reply #1 on: May 31, 2017, 02:11:08 AM »
You don't have to have a dedicated key just for "tab"... you can use a combo ;)

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 252
    • View Profile
    • Github Repositories
Re: Configure AM using script instead of Tab key
« Reply #2 on: May 31, 2017, 06:13:13 AM »
Yes. I get that, thanks for the suggestion.. But I would still prefer just being able to make a selection.

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
Re: Configure AM using script instead of Tab key
« Reply #3 on: May 31, 2017, 08:00:39 AM »
fe.signal("configure") ¿maybe this?

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 252
    • View Profile
    • Github Repositories
Re: Configure AM using script instead of Tab key
« Reply #4 on: June 02, 2017, 07:01:10 PM »
I'll take a look. Taking any ideas right now :-)

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: Configure AM using script instead of Tab key
« Reply #5 on: June 02, 2017, 10:36:18 PM »
yep, fe.signal("configure") will launch settings just like pressing tab :)

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 252
    • View Profile
    • Github Repositories
Re: Configure AM using script instead of Tab key
« Reply #6 on: June 02, 2017, 11:02:37 PM »
I haven't investigated yet... I've been writing a screen saver tonight.

So... forgive my asking: how would one trigger fe.signal("configure") by clicking on a rom? I realize I could make a menu and do something that way, but it'd take a lot longer than leveraging the standard romlist. Maybe I'm not thinking about it right.

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 252
    • View Profile
    • Github Repositories
Re: Configure AM using script instead of Tab key
« Reply #7 on: June 02, 2017, 11:12:30 PM »
Maybe something like this:

Code: [Select]
fe.add_signal_handler("check_select");
function check_select( sig )
{
   if ( sig == "select" )
   {
       if ([insert rom stuff here] == [romname])
      {
            fe.signal("configure")
            return true;
       }
    }

   return false;
}

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 252
    • View Profile
    • Github Repositories
Re: Configure AM using script instead of Tab key
« Reply #8 on: June 02, 2017, 11:36:28 PM »
This worked:

Code: [Select]
fe.add_signal_handler("check_select");
function check_select( sig )
{
   if ( sig == "select" )
   {
       if (fe.game_info( Info.Title ) == "Press TAB to Configure")
      {
            fe.signal("configure")
            return true;
       }
    }

   return false;
}