Author Topic: KeyboardSearch module  (Read 4589 times)

kent79

  • Hero Member
  • *****
  • Posts: 517
    • View Profile
Re: KeyboardSearch module
« Reply #15 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.

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: KeyboardSearch module
« Reply #16 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.

kent79

  • Hero Member
  • *****
  • Posts: 517
    • View Profile
Re: KeyboardSearch module
« Reply #17 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" );
« Last Edit: November 10, 2017, 05:08:14 PM by kent79 »

kent79

  • Hero Member
  • *****
  • Posts: 517
    • View Profile
Re: KeyboardSearch module
« Reply #18 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.

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: KeyboardSearch module
« Reply #19 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.

kent79

  • Hero Member
  • *****
  • Posts: 517
    • View Profile
Re: KeyboardSearch module
« Reply #20 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  :)
« Last Edit: November 16, 2017, 10:34:32 PM by kent79 »

kent79

  • Hero Member
  • *****
  • Posts: 517
    • View Profile
Re: KeyboardSearch module
« Reply #21 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

kent79

  • Hero Member
  • *****
  • Posts: 517
    • View Profile
Re: KeyboardSearch module
« Reply #22 on: November 18, 2017, 05:34:09 AM »
Below format is OK. The pointer is correct   :)

IceLancer

  • Full Member
  • ***
  • Posts: 44
    • View Profile
Re: KeyboardSearch module
« Reply #23 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

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: KeyboardSearch module
« Reply #24 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.

IceLancer

  • Full Member
  • ***
  • Posts: 44
    • View Profile
Re: KeyboardSearch module
« Reply #25 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

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: KeyboardSearch module
« Reply #26 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.

Arcadefan1

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: KeyboardSearch module
« Reply #27 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!

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: KeyboardSearch module
« Reply #28 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.

IceLancer

  • Full Member
  • ***
  • Posts: 44
    • View Profile
Re: KeyboardSearch module
« Reply #29 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