Author Topic: Using modules - I'm a new user  (Read 2181 times)

markoattract

  • Full Member
  • ***
  • Posts: 54
    • View Profile
Using modules - I'm a new user
« on: August 15, 2018, 11:09:05 AM »
Hello all Guys !

I'm an italian retrogaming-fan, so i'm sorry for my english :D

I'm just entering into the world of Attract mode and it's AWESOME !

I don't know squirrel language but i want to learn ... meanwhile i want to integrate into "Cosmo" theme , the module for the on-screen keyboard search ...

Please can you help me to modify the "layout.nut" file so i can use it ??

I'v already downloaded the "keyboard-search" module and put it into "Modules" folder ... Now what i have to write into layout.nut ???

tank you for your cooperation.

- Mark - ;)

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: Using modules - I'm a new user
« Reply #1 on: August 15, 2018, 04:15:27 PM »
At the beginning where the options are listed add
Code: [Select]
   </ label="Search Key", help="Choose the key to initiate a search", options="custom1,custom2,custom3,custom4,custom5,custom6", order=10 /> user_search_key="custom1";
   </ label="Search Results", help="Choose the search method", options="show_results,next_match", order=11 /> user_search_method="show_results";


Near the beginning (where the modules are loaded) add
Code: [Select]
fe.load_module("objects/keyboard-search");

Near the middle (after the pointers section) add
Code: [Select]
// search
local search_surface = fe.add_surface(fe.layout.width * 0.5, fe.layout.height)
KeyboardSearch(search_surface)
    .keys_pos([ 0.05, 0.4, 0.9, 0.5 ])
    .search_key( my_config["user_search_key"] )
    .mode( my_config["user_search_method"] )
    .init()


You also need to configure one of the "Custom buttons" in AM Configure-->Controls-->Custom X = ? and also in the layout options.

markoattract

  • Full Member
  • ***
  • Posts: 54
    • View Profile
Re: Using modules - I'm a new user
« Reply #2 on: August 16, 2018, 02:07:09 AM »
Thank you very much Progets !!

I will try this ! :D