Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: liquid8d on October 28, 2017, 05:35:25 PM

Title: KeyboardSearch module
Post by: liquid8d on October 28, 2017, 05:35:25 PM
I just pushed my keyboard-search module to github.. have at it! It's completely customizable, see  the README for usage:

https://github.com/liquid8d/attract-extra/tree/master/modules/objects/keyboard-search

(https://i.imgur.com/IlRCoix.png)

I haven't worked on this recently and wanted to get it and my layout that uses it out there, so let me know if you come across any bugs. There may be issues with different orientations or aspect ratios.
Title: Re: KeyboardSearch module
Post by: calle81 on October 29, 2017, 04:37:24 PM
Wow, awesome! Works great! Thanks for this. :)
Title: Re: KeyboardSearch module
Post by: SomeoneElse on November 04, 2017, 05:21:41 PM
Sorry for newb question. But i am not following..
is this extension of plugin search within attract or module by it self?

because keyboard search plugin when activated is nothing like ur search module and its unusable for me as it crashes all the time.

So what am i missing? if plugin is deactivated custom1 key does nothing at all
Title: Re: KeyboardSearch module
Post by: kent79 on November 04, 2017, 05:30:43 PM
Sorry for newb question. But i am not following..
is this extension of plugin search within attract or module by it self?

because keyboard search plugin when activated is nothing like ur search module and its unusable for me as it crashes all the time.

So what am i missing? if plugin is deactivated custom1 key does nothing at all

Please see the guide first.  :)

https://github.com/liquid8d/attract-extra/blob/master/modules/objects/keyboard-search/README.md
Title: Re: KeyboardSearch module
Post by: kent79 on November 04, 2017, 05:32:00 PM
Hope it can add "Confirm" button later. Thanks.  :)
Title: Re: KeyboardSearch module
Post by: SomeoneElse on November 04, 2017, 05:35:33 PM
Sorry for newb question. But i am not following..
is this extension of plugin search within attract or module by it self?

because keyboard search plugin when activated is nothing like ur search module and its unusable for me as it crashes all the time.

So what am i missing? if plugin is deactivated custom1 key does nothing at all

Please see the guide first.  :)

https://github.com/liquid8d/attract-extra/blob/master/modules/objects/keyboard-search/README.md

i did read it. it mentions calling function from within layout , but there are no basic guides on doing so. my next best guess is tha ti need to call the function from within theme it self?
ok im getting somewhere, still something is breaking it.
i added
fe.load_module("objects/keyboard-search");
local search_surface = fe.add_surface(fe.layout.width, fe.layout.height)
KeyboardSearch(search_surface).init()
to module list in theme layout, but visibility is breaking up. maybe due to my snap background..will figure out..


P.S
yeah my snap background is breaking any visibility of search module. And its stretched out i can only see keyboard. I am not knowlegable in this coding language so this ends my attempt.

Anyway nice to see good looking search for attract
Title: Re: KeyboardSearch module
Post by: liquid8d on November 04, 2017, 10:54:39 PM
I do plan on adding a DONE or CONFIRM :)

SomeoneElse:

This is a module, meant for layout designers. However, if you are making your own layout - you are welcome to try it out.
First, make sure you are adding the search surface (the add_surface line) AFTER your background and other objects that you don't want ontop of the search.

Also, the default search key is "custom1" - if that is bound to something else, that might cause you problems. You can set it directly by adding .search_key("custom2") to the init line, or add the user config options as shown in the README to your layout.
Title: Re: KeyboardSearch module
Post by: progets on November 05, 2017, 12:26:56 AM
Very cool module. Great job liquid8d!
Title: Re: KeyboardSearch module
Post by: SomeoneElse on November 05, 2017, 03:09:52 AM
I do plan on adding a DONE or CONFIRM :)

SomeoneElse:

This is a module, meant for layout designers. However, if you are making your own layout - you are welcome to try it out.
First, make sure you are adding the search surface (the add_surface line) AFTER your background and other objects that you don't want ontop of the search.

Also, the default search key is "custom1" - if that is bound to something else, that might cause you problems. You can set it directly by adding .search_key("custom2") to the init line, or add the user config options as shown in the README to your layout.

i did that first time, although because i didnt see any load order or brackets for functions in this coding i thought it wont matter now i understand that it calls from top to bottom. So added at the bottom of script to avoid everything and visibility is fine now.

Although im not sure where to define size x y of search?
i am only seeing leters from keyboard not the search result on the right side as shown in ur picture

https://i.imgur.com/MAnXRya.jpg
this is what i mean

searching atari dropped me at first atari, without that seek list on right side. i have more then one atari
-----
i managed to make search box smaller by utilizing half screen 0.5 instead of 1.0 but i am still not getting list on right side, is that part of another module ? or am i missing something

P.S i guess its not possible to actually allow keyboard typing be used as search?

P.P.S
The reason why i bother u and sorry if i am. Is because the actual fully functional implemented search in some theme and posted will probably be done , never.Considering how empty things are of late..So i am just trying to enable this very good stuff for my self at least.
Title: Re: KeyboardSearch module
Post by: liquid8d on November 05, 2017, 08:09:34 AM
The list is in my layout.

AttractMode has a command to filter your results based on search text. The module just calls this command with the text you input, but your layout has to show the actual games - either through a list, or adding objects that have index_offset set to show a set of games.

Also, added keyboard typing to TODO :)
Title: Re: KeyboardSearch module
Post by: liquid8d on November 05, 2017, 02:16:50 PM
I added a DONE key, along with an option to retain the search when you reopen it. You can also now default to text only instead of images by just passing null to keys_image_folder() and set the keys charsize with .keys_charsize().

As for keyboard input, I realize why i didn't add it - I'm not sure if you can override (grab) individual keyboard keys, at least with a module. Have to look into it further.

You can grab the changes here:

https://github.com/liquid8d/attract-extra/tree/master/modules/objects/keyboard-search

As I was making the changes, I realized it was not very clearly explained and I struggled myself to setup the default stuff  ;D Some of the instructions were pulled directly from my blueprint layout and still had user_config[...] in there.

I'm going to update the instructions a bit. In the meantime, I added a sample layout:
https://github.com/liquid8d/attract-extra/tree/master/layouts/sample_keyboard_search

Probably the most confusing thing is text_pos() and keys_pos() - this is a 0-1 map of x, y, w, h on where the search text and key layout will be within the *search surface*. For example:

Code: [Select]
local search_surface = fe.add_surface(fe.layout.width / 2, fe.layout.height);
local keyboard = KeyboardSearch(search_surface)

Code: [Select]
keyboard.text_pos( 0, 0, 1, 0.1 )
Here the search text will occupy the full width of the search surface (or half the screen). It will occupy 10% (0.1) of the height of the search surface.

Code: [Select]
keyboard.text_pos( 0, 0.5, 1, 0.5 )
Here the keys (all of them) will occupy the bottom half of the search surface ( y = 0.5 and height = 0.5, or half of search surface height).

Hopefully that makes sense.
Title: Re: KeyboardSearch module
Post by: kent79 on November 06, 2017, 03:35:52 PM
@liquid8d

I would like to add this module in my "AMGPS Theme".  Every is good, but one thing can't fix it.

I don't know to make Game time out counter reset while keyboard screen closed. Could you help me to check it? Thanks.

//reset timeout
count = user_interval;
ui_counter.msg = count;
Title: Re: KeyboardSearch module
Post by: liquid8d on November 07, 2017, 08:22:49 PM
hi kent, not sure what you mean? Are you saying you want to do that when the keyboard is closed?
Title: Re: KeyboardSearch module
Post by: kent79 on November 07, 2017, 09:59:03 PM
hi kent, not sure what you mean? Are you saying you want to do that when the keyboard is closed?

Yes. Sorry my English doesn't good enough  :)
Title: Re: KeyboardSearch module
Post by: liquid8d on November 08, 2017, 03:25:23 PM
No problem! There is a toggle() method in there which is called to show or hide the keyboard. All it does is switch the keyboard surface alpha to 0 or 255. You could hook into that, if ( surface.alpha == 0 ) //do your stuff.

Title: Re: KeyboardSearch module
Post by: kent79 on November 09, 2017, 03:06:43 PM
No problem! There is a toggle() method in there which is called to show or hide the keyboard. All it does is switch the keyboard surface alpha to 0 or 255. You could hook into that, if ( surface.alpha == 0 ) //do your stuff.

@liquid8d

I try to add script on AMGPS game layout, but not working.  :-[

It is many appreciate if you help to fix it. Many Thanks.
Title: Re: KeyboardSearch module
Post by: liquid8d on November 09, 2017, 04:03:22 PM
kent,

Right now, you are only checking if the surface is visible when your layout starts, and that's it. The layout doesn't reload or anything when the search is hidden or shown. Perhaps you can check in tick?

Code: [Select]
local search_surface = ....
KeyboardSearch(...)...

local searchVisible = 0;
function on_tick(ttime) {
   ...
   if ( search_surface.alpha != searchVisible ) {
      //search has been toggled
      searchVisible = search_surface.alpha;
      if ( search_surface.alpha == 0 ) {
         //search was hidden
      } else {
         //search was shown
      }
   }
}

Maybe I can add some kind of listener to notify you when the keyboard has been shown or hidden if that doesn't work for you.
Title: Re: KeyboardSearch module
Post by: kent79 on November 10, 2017, 04:39:08 PM
Hello liquid8d

Below is my updated script. The counter msg can be reset while keyboard screen closed.

But there is some issue. When keyboard is opened, the counter is still running count-- in BG.

1. When counter value >0 and then quit keyboard. It is normal result.

2. When counter value <0 and then quit keyboard. It will quit to "displays_menu" directly.

I know it should be related as below line in script, but I don't how to fix. Could you help again? Thank you.

if ( count <= 0 ) {
            fe.signal( "displays_menu" );
Title: Re: KeyboardSearch module
Post by: kent79 on November 15, 2017, 02:42:01 PM
@liquid8d

I find something issue for module.

If on STUVWXYX button, when I press down. It will goto different button (clr, space, del &ok)

Could you centralized it o be "OK" button? Thanks.
Title: Re: KeyboardSearch module
Post by: liquid8d on November 16, 2017, 08:26:16 AM
I'll see if I can look at your script and this issue tonight. I think the issue with selecting a certain button is more difficult because which buttons are on a row is configurable. It does make sense, though. I'll see what I can do with it.
Title: Re: KeyboardSearch module
Post by: kent79 on November 16, 2017, 11:00:26 AM
Wait for your Good new . I also have a good news. I have fixed count issue for AMGPS. I know how to stop count while keyboard opening  :)
Title: Re: KeyboardSearch module
Post by: kent79 on November 16, 2017, 10:43:30 PM
I think as bekow result is accepted

STUVWXYX -> Done

OR

S -> clr
T -> clr
U -> space
V -> space
W -> del
X -> del
Y -> Done
X -> Done


But current:

S -> clr
T -> space
U -> del
V -> Done
W -> clr
X -> clr
Y -> clr
X -> clr
Title: Re: KeyboardSearch module
Post by: kent79 on November 18, 2017, 05:34:09 AM
Below format is OK. The pointer is correct   :)
Title: Re: KeyboardSearch module
Post by: IceLancer on December 06, 2017, 05:05:40 AM
Do you think u could add to accept keyboard input for typing?although i dont know if its even possible with current state of AM
Title: Re: KeyboardSearch module
Post by: liquid8d on December 08, 2017, 11:56:36 AM
That's one of the things on my list - I believe that's the issue I ran into, it was difficult to listen for arbitrary key presses. Think it has to use get_input_state and listen for all keyboard presses, so it might be possible just take a bit more work.
Title: Re: KeyboardSearch module
Post by: IceLancer on December 08, 2017, 01:17:40 PM
i am thinking out loud here, but i noticed that that customkeys are being called if u attempt to type when search is open. Maybe do it the same way? write custom keyboard layout which will then have to take priority over custom keys input and just do the job
Title: Re: KeyboardSearch module
Post by: liquid8d on December 09, 2017, 08:52:46 AM
Right, it probably should override at least some of those - but that is all just handled using the signal handler. signal handler doesn't allow for catching individually pressed keys if I'm not mistaken. I think to do that, I need to use get_input_state.. I had some of the code in there testing it out, but ran into issues. This also should really be a plugin that can replace the current keyboard search, but I think I had issues doing that as well  :'(

I look at it today and see what's possible.
Title: Re: KeyboardSearch module
Post by: Arcadefan1 on December 10, 2017, 08:06:14 AM
Hi liquid8d,
I am trying out your search module. I like it very much! But I noticed one small thing. When I search for something the list is updated properly and contains the results. But the artwork is not updated to the selected game on the list. Let's say the search result list shows "bubble bobble" but the layout is still showing the artwork of a different game. I hope you get what I mean. I know my English is bad. ;)
So, is there a way to refresh the display after a search result?

Thx!
Title: Re: KeyboardSearch module
Post by: liquid8d on December 10, 2017, 04:51:24 PM
I'll have to check that out. Do you mean after you exit the search? Remember that the list is a list - it isn't showing the "selected" game. This is why typically you might want to cover - at least partially - your main layout when searching.

FYI, I haven't got to look at adding keyboard typing yet, but I'll do that soon.
Title: Re: KeyboardSearch module
Post by: IceLancer on December 10, 2017, 07:26:34 PM
Hi liquid8d,
I am trying out your search module. I like it very much! But I noticed one small thing. When I search for something the list is updated properly and contains the results. But the artwork is not updated to the selected game on the list. Let's say the search result list shows "bubble bobble" but the layout is still showing the artwork of a different game. I hope you get what I mean. I know my English is bad. ;)
So, is there a way to refresh the display after a search result?

Thx!

It depends on your layout , in my layout i have custom code which works on tick, to prevent snaps and artwork changes during fast scrolling. It will also prevent this from changing instantly on search, it can cause heavy lag on pie.But it will update on next navigation or transition
Title: Re: KeyboardSearch module
Post by: Arcadefan1 on December 11, 2017, 05:15:52 AM
Hi guys!
I've figured it out. When I add a line of code, the search result will update the shown artwork on the fly, every time you change the search term. Before the change it seems that it is only done when the "fe.list.search_rule" is set with content for the first time. After that the artwork won't refresh. So what I did was clear the search_rule before adding another letter to the search term...

Look at the code snippet...
Code: [Select]
//update the current search rule
    function update_rule()
    {
        try
        {
            local rule = "Title contains " + _massage(text)
            print( "Rule: " + rule )
            switch ( config.mode )
            {
                case "next_match":
                    print("jumping to: " + text)
                    if ( text.len() == 0 ) return
                    local s = fe.filters[fe.list.filter_index].size
                    for ( local i = 1; i &lt; s; i++ )
                    {
                        local name = fe.game_info( Info.Title, i ).tolower()
                        if ( regexp( text ).capture(name) ) {
                            fe.list.index = (fe.list.index+i)%s
                            break
                        }
                    }
                    break
                case "show_results":
                default:
                    print("results for: " + text)
                    //fe.list.search_rule = "Title contains mario"

 // the following line does the trick
    fe.list.search_rule = ""
// -------------------------------------------------

                    fe.list.search_rule = ( text.len() &gt; 0 ) ? rule : ""
                    break
            }
        } catch ( err ) { print( "Unable to apply filter: " + err ); }
    }


I run attract mode on my vertical CRT cab. Have a look at how I have integrated the search module...
http://sendvid.com/thyu2zdh
Probably not the best video hoster, but I have no idea how to show you guys a video here

Edit:

Ok! Just skip the video if you don't have an add blocker... it just showed me an ass. ;) ok, the ass was not bad, but who knows what comes along with it..????
Title: Re: KeyboardSearch module
Post by: liquid8d on December 11, 2017, 10:24:34 AM
I'll check this out tonight. I was able to get typing working for the most part.. still have to figure out some things, like if your search key is a letter, you obviously can't use it to toggle search for instance.
Title: Re: KeyboardSearch module
Post by: liquid8d on December 11, 2017, 03:48:22 PM
Oh, great, I see what you mean now - next_match already selects the next match in the results, but show_results doesn't. Might take me a day or two to work out some of the bugs and add a few features I want, but should have an update pretty soon  :D

As for where to put videos (yes, ublock origin saved me):
https://gfycat.com (converts to gifs, which you can then include in your post with the img tag)
https://www.dropbox.com (create a share link, it will auto-embed videos to play)
https://youtube.com (self explanatory) :)
https://vimeo.com (alternate option)
Title: Re: KeyboardSearch module
Post by: Bbuschke on April 19, 2018, 09:08:50 AM
i cant get this working. Does the .nut file go in the plugins folder? Thats where I have it. when i view plugins in attractmode it allows me to turn it on but not select what triggers it to work.
Title: Re: KeyboardSearch module
Post by: Marcoqwerty on July 15, 2018, 06:52:10 AM
Hi...

I have some trouble to istalling this module, actually i have:

- placed the /modules/objects/keyboard-search/ in the same folder
- copy the code in my module (all showed in the wiki)
- assigned the custom1 key

Nothing happens at the pression of the key, its the fist time i try to install a module....if someone can help me a bit.  ;D
Title: Re: KeyboardSearch module
Post by: arthurvalenca on August 13, 2018, 07:01:19 PM
my search screen is in the upper left corner, my question is, and how do I get it to the center of the screen?
Title: Re: KeyboardSearch module
Post by: iOtero on August 14, 2018, 02:19:54 AM
my search screen is in the upper left corner, my question is, and how do I get it to the center of the screen?

This is what i do:
Code: [Select]

// Search
local search_surface = fe.add_surface(flw*0.375, flh*0.4)
KeyboardSearch(search_surface)
    .search_key(my_config["search_key"])
    .mode(my_config["search_method"])
    .text_color(255,255,255,125)
    .keys_color(255,255,255,125)
    .keys_selected_color(255,0,0,125)
    .init()
search_surface.set_pos(flx*0.215, fly*0.36, flw*0.375, flh*0.4);
Title: Re: KeyboardSearch module
Post by: iOtero on September 11, 2018, 06:54:57 AM
I'm going to request that you add the CAPS key to the keyboard-search.

I explain my need:

I have several consoles:

Sega Genesis
NES
SNES

If I use keyboard-search entering nes, it only returns Sega Genesis, when it should also return NES and SNES.

It does not, because the search is "Title contains [Nn]es", and I need "Title contains [Nn]es or NES". (Is only one example, sorry.)

So I would appreciate it if you enabled the CAPS key, or you could give me some solution to my problem.

Thanks you for your work.
Title: Re: KeyboardSearch module
Post by: iOtero on October 30, 2018, 07:29:56 AM
Well, since I have not read anyone...

I solved it myself:

In the module keyboard-search.nut , just substitute this line of code:
Code: [Select]
             local rule = "Title contains" + _massage (text)
for this other:
Code: [Select]
             local rule = "Title contains" + _massage (text) + "|" + text.toupper ();

Thanks for nothing...  8)
Title: Re: KeyboardSearch module
Post by: Wenzon on June 17, 2019, 10:45:25 AM
Hi...

I have some trouble to istalling this module, actually i have:

- placed the /modules/objects/keyboard-search/ in the same folder
- copy the code in my module (all showed in the wiki)
- assigned the custom1 key

Nothing happens at the pression of the key, its the fist time i try to install a module....if someone can help me a bit.  ;D


I have the same difficulty as Marcoqwerty. I did the same procedure with no results. I have worked for months on a custom theme for my bartop and to conclude it, I need to include this module to be perfect.

I'm putting the attached layout.nut to see if anyone helps me. I'm almost giving up.  :(


Title: Re: KeyboardSearch module
Post by: Wenzon on June 19, 2019, 08:32:06 AM
I'm not sure but think something is missing in this line for the module to work on my theme.
Code: [Select]
local search_surface = fe.add_surface(fe.layout.width, fe.layout.height)
Title: Re: KeyboardSearch module
Post by: iOtero on June 22, 2019, 10:27:18 AM
I'm not sure but think something is missing in this line for the module to work on my theme.
Code: [Select]
local search_surface = fe.add_surface(fe.layout.width, fe.layout.height)

Try:

Code: [Select]
local flwc = fe.layout.width;
local flhc = fe.layout.height;

local search_surface = fe.add_surface(flwc, flhc)
Title: Re: KeyboardSearch module
Post by: Wenzon on June 23, 2019, 07:12:01 AM
I'm not sure but think something is missing in this line for the module to work on my theme.
Code: [Select]
local search_surface = fe.add_surface(fe.layout.width, fe.layout.height)

Try:

Code: [Select]
local flwc = fe.layout.width;
local flhc = fe.layout.height;

local search_surface = fe.add_surface(flwc, flhc)

nothing.  :'(
Title: Re: KeyboardSearch module
Post by: iOtero on June 23, 2019, 07:34:15 AM
Run:
Code: [Select]
attract --loglevel debug

launch the keyboardsearch module and put here the last_run.log file.
Title: Re: KeyboardSearch module
Post by: Wenzon on June 23, 2019, 08:44:50 AM
Run:
Code: [Select]
attract --loglevel debug

launch the keyboardsearch module and put here the last_run.log file.

I'm putting 2 files. One log and the other layout. I put the module script in the last line of the layout file.
Title: Re: KeyboardSearch module
Post by: iOtero on June 23, 2019, 10:24:09 AM
Run:
Code: [Select]
attract --loglevel debug

launch the keyboardsearch module and put here the last_run.log file.

I'm putting 2 files. One log and the other layout. I put the module script in the last line of the layout file.

The [ ] in the colors must be removed.
And I would leave the function like this:

Code: [Select]
fe.load_module("objects/keyboard-search");
local search_surface = fe.add_surface(fe.layout.width, fe.layout.height)
KeyboardSearch(search_surface)
    .search_key(my_config["user_search_key"])
    .mode(my_config["user_search_method"])
    .text_color(255,0,255,255)
    .keys_color(255,255,255,255)
    .keys_selected_color(255,50,255,255)
    .init()
search_surface.set_pos(0, 0, fe.layout.width, fe.layout.height);

Title: Re: KeyboardSearch module
Post by: Wenzon on June 23, 2019, 02:17:34 PM
Run:
Code: [Select]
attract --loglevel debug

launch the keyboardsearch module and put here the last_run.log file.

I'm putting 2 files. One log and the other layout. I put the module script in the last line of the layout file.

The [ ] in the colors must be removed.
And I would leave the function like this:

Code: [Select]
fe.load_module("objects/keyboard-search");
local search_surface = fe.add_surface(fe.layout.width, fe.layout.height)
KeyboardSearch(search_surface)
    .search_key(my_config["user_search_key"])
    .mode(my_config["user_search_method"])
    .text_color(255,0,255,255)
    .keys_color(255,255,255,255)
    .keys_selected_color(255,50,255,255)
    .init()
search_surface.set_pos(0, 0, fe.layout.width, fe.layout.height);

Thaaaaaaaannnnnnnkkkkkkkkouuuuuuuuu!!!! Wonderful, spectacular, amazing !!! I have no words to thank. I would hardly solve this problem.
I do not think I'm going to stop thanking you. Thank you very much for your time and help.  :)
Title: Re: KeyboardSearch module
Post by: iOtero on June 24, 2019, 04:54:03 AM
Thanks. I'm glad i was useful.  :-[
Title: Re: KeyboardSearch module
Post by: Wenzon on June 25, 2019, 10:13:33 AM
A doubt.
Can you decrease the font size when you are selecting a letter or number?
Title: Re: KeyboardSearch module
Post by: iOtero on June 26, 2019, 03:09:18 AM
A doubt.
Can you decrease the font size when you are selecting a letter or number?

From what i have seen analyzing the module, you can not.
Title: Re: KeyboardSearch module
Post by: arthurvalenca on July 24, 2019, 01:18:45 PM
Hello all!
I really like the plugin, but I still have a doubt, as it makes for the search letters to be uppercase, I've tried several ways but could not leave "ABCDE". help please
Title: Re: KeyboardSearch module
Post by: iOtero on July 25, 2019, 08:30:31 AM
Hello all!
I really like the plugin, but I still have a doubt, as it makes for the search letters to be uppercase, I've tried several ways but could not leave "ABCDE". help please

You haven't read all the thread, my friend...  8)

My Request:
http://forum.attractmode.org/index.php?topic=1946.msg16685#msg16685
 (http://forum.attractmode.org/index.php?topic=1946.msg16685#msg16685)
My Solution:
http://forum.attractmode.org/index.php?topic=1946.msg17447#msg17447 (http://forum.attractmode.org/index.php?topic=1946.msg17447#msg17447)
Title: Re: KeyboardSearch module
Post by: arthurvalenca on July 25, 2019, 05:51:12 PM
Hello all!
I really like the plugin, but I still have a doubt, as it makes for the search letters to be uppercase, I've tried several ways but could not leave "ABCDE". help please

You haven't read all the thread, my friend...  8)

My Request:
http://forum.attractmode.org/index.php?topic=1946.msg16685#msg16685
 (http://forum.attractmode.org/index.php?topic=1946.msg16685#msg16685)
My Solution:
http://forum.attractmode.org/index.php?topic=1946.msg17447#msg17447 (http://forum.attractmode.org/index.php?topic=1946.msg17447#msg17447)

Even after changing the code as you showed I still get lowercase letters, any ideas?

(http://i67.tinypic.com/vrrqyd.png)
Title: Re: KeyboardSearch module
Post by: iOtero on July 26, 2019, 06:14:02 AM
Well, apparently I have not understood exactly what you want to do. As you do not explain yourself better...  8)

What are you talking about? Search results or keyboard appearance?  8)
Title: Re: KeyboardSearch module
Post by: FrizzleFried on July 26, 2019, 07:27:36 AM
Well, apparently I have not understood exactly what you want to do. As you do not explain yourself better...  8)

What are you talking about? Search results or keyboard appearance?  8)

I think he's looking to make the typed result all uppercase while it's all lowercase at this point.
Title: Re: KeyboardSearch module
Post by: arthurvalenca on July 26, 2019, 09:37:01 AM
Well, apparently I have not understood exactly what you want to do. As you do not explain yourself better...  8)

What are you talking about? Search results or keyboard appearance?  8)

I think he's looking to make the typed result all uppercase while it's all lowercase at this point.

that's right!!!!!!!! result all uppercase.
Title: Re: KeyboardSearch module
Post by: iOtero on July 26, 2019, 12:45:11 PM
In module.nut change this line

Code: [Select]
        search_text.msg = ( text == "" ) ? "" : "\"" + text + "\""

for this line

Code: [Select]
        search_text.msg = ( text == "" ) ? "" : "\"" + text.toupper() + "\""

And this line

Code: [Select]
            local rule = "Title contains " + _massage(text);

for this line

Code: [Select]
            local rule = "Title contains " + _massage(text) + "|" + text.toupper();

I don't know if you want it that way for aesthetics or because you have all the names of the games in capital letters. Depending on that, you may have to make some more changes to the module to make it work properly.

And I'm not the creator of the module, so I hope liquid8d doesn't get mad at me for modifying its code so much.
Title: Re: KeyboardSearch module
Post by: arthurvalenca on July 26, 2019, 01:32:41 PM
In module.nut change this line

Code: [Select]
        search_text.msg = ( text == "" ) ? "" : "\"" + text + "\""

for this line

Code: [Select]
        search_text.msg = ( text == "" ) ? "" : "\"" + text.toupper() + "\""

And this line

Code: [Select]
            local rule = "Title contains " + _massage(text);

for this line

Code: [Select]
            local rule = "Title contains " + _massage(text) + "|" + text.toupper();

I don't know if you want it that way for aesthetics or because you have all the names of the games in capital letters. Depending on that, you may have to make some more changes to the module to make it work properly.

And I'm not the creator of the module, so I hope liquid8d doesn't get mad at me for modifying its code so much.

Big Thanks iOtero!!!!!!!!!

(http://i64.tinypic.com/2ujl9xi.png)

My last question is how can I expand the background image of the virtual keyboard to full screen without having to change the size of the keyboard?
Title: Re: KeyboardSearch module
Post by: iOtero on July 26, 2019, 02:36:02 PM
I would advise you not to make any changes. The screen looks great according to the screenshot you've sent. On such a big screen, it's very good like that. Sometimes we want to have our frontend so good that we start doing very unnecessary things, and I know a lot about that, because I've been wrong many times.

At most, what I would do would be to center it on the screen, and if you want to see everything black behind, you just have to use a jpg or png of 1 pixel white and paint with it the whole screen in black or semitransparent with the alpha level you want:

Code: [Select]
local flw = fe.layout.width;
local flh = fe.layout.height;

local search = fe.add_image("objs/pixel_white.png", 0, 0, flw, flh);
search.set_rgb(0,0,0);
search.alpha = 255;

But I insist that I would do nothing, I like it as I see it.
Title: Re: KeyboardSearch module
Post by: Wenzon on September 28, 2019, 11:17:40 AM
I want to remove as quotes when you start typing in search. And also add total items found on that same screen. It's possible?
Title: Re: KeyboardSearch module
Post by: iOtero on September 30, 2019, 05:29:32 AM
All my themes always have an on-screen game counter, like this one:

Code: [Select]
local contador = fe.add_text("[ListEntry]/[ListSize]", flx*0.4, fly*0.9, flw*0.5, flh*0.3);
And when searching with keyboard-search the counter is updated with the data found. So it will not be complicated to mount it on your own.


And as for quotes, very easy, open the keyboard-search module and replace this line:

Code: [Select]
search_text.msg = ( text == "" ) ? "" : "\"" + text + "\""

for this one:

Code: [Select]
search_text.msg = ( text == "" ) ? "" : text
Title: Re: KeyboardSearch module
Post by: Wenzon on October 02, 2019, 10:39:11 AM
Thank you iOtero"  ;D