Rockbox Technical Forums

Support and General Use => Plugins/Viewers => Topic started by: Bilgus on March 06, 2021, 05:31:34 PM

Title: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 06, 2021, 05:31:34 PM
Ok I see where the shortcuts menu won't run the shortcut I'll look into it this week

Note: I remembered messing with the shortcuts menu when I implemented this I had to look back
the shortcut menu should now start plugins instead of pulling you to the file location
I'll expand on that a bit to make the opx shortcuts work the same
Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 07, 2021, 02:42:51 AM
> the shortcut menu should now start plugins instead of pulling you to the file location

It doesn't work for me when called from WPS (Shortcuts Menu instead of Quick Screen) - plugins are not started (tested with lrcplayer). It only works when I enter Shortcuts menu from main menu.

> I'll expand on that a bit to make the opx shortcuts work the same
Would also be cool to be able to run lua scripts directly too.

Please also consider changing the way "runnable" items are displayed in Shortcuts menu. I think it's better to show just name for such items without full path. Or maybe change the way path is displayed. Suggested format  "fileName (fullpath)" Something like "MyScript.opx (/.rockbox/rocks/apps/MyScript.opx)
Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 07, 2021, 09:22:18 AM
> Would also be cool to be able to run lua scripts directly too.

I've just found it's already possible in poretsky's rockbox build (shortcuts need to be recreated). Related commit: https://github.com/poretsky/rockbox/commit/8fec06d95231cb4bf18ddf8c9caa2e10f3be534e
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 07, 2021, 10:26:34 AM
I've added a few updates to the shortcuts menu
- allow executing browser shortcuts directly
- show file name then full path in parens ex: test.rock (/.rockbox/rocks/apps/test.rock)

we can add those changes from igor too but it should be in a separate commit

 
Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 07, 2021, 03:16:52 PM
Awesome work!

My testing results:
1) I've noticed a slight difference in behavior for plugins and opx shortcuts when started from WPS. Plugin (lrcplayer) on exit returns right back to WPS which is very convenient. Opx shortcut (for lua script) returns to main menu. Can it behave the same (return back to WPS when Shortcuts menu is called instead of Quick Screen from WPS)? Exiting Shortcuts menu also always leads to main menu - would love to see it returning back to WPS when called from WPS.
2) If your are inside main menu and enters Shortcuts menu by hot key (Shortcuts menu is used instead of Quick Screen so it's Long Home  on Sansa Clip Zip) - plugins/opx are not working.
3) Directory icons are shown for such plugins and opx files.

And can we also quit Shortcuts menu on Home button (Sansa Clip Zip)? To have common exit button for both Shortcuts and Quick Screen.

Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 07, 2021, 05:31:33 PM
I must have missed the one on the main menu I'll get it next

As far as where it returns when done  I'll have to look into it, I mean we have a way to
push and pop the current activity so it should be possible

I'll look into the icons and making the exit keys match as well

Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 08, 2021, 10:22:11 PM
Ok, I think thats all sorted now
Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 09, 2021, 03:14:13 AM
Opx now returns back to WPS - cool!!!

But exiting Shortcuts menu still always leads to main menu for me. Can this also be changed?

> can we also quit Shortcuts menu on Home button (Sansa Clip Zip)

It doesn't work for me. HOME button still does nothing in Shortcuts menu. BUTTON_HOME is treated as exit button in quick screen and most others menus but does nothing in Shortucts menu. That's what I meant initially. Seems related button mapping for quicksrceen: https://github.com/Rockbox/rockbox/blob/ca4d63d4d903e3de356afb8d129ae61c660ff9b4/apps/keymaps/keymap-clip.c#L182

Regarding icons it seems now plugin icon is always used even if it's shortcut for BROWSE action to some particular folder or file. So if someone uses Shortucts menu for folders bookmarking (not me) - might find this confusing. If it's hard to show plugin icon only for "runnable" items - maybe just return back directory icon to avoid further questions...

And thanks for your work
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 09, 2021, 06:52:14 AM
try long press home.. I did make it ignore it if the context button == quickscreen button but that won't matter for the clipzip

Also the icons, that is a fine of control as it has do you like the folder icon or plugin icon for the Browser shortcuts... folders should still get a folder icon though looking at the code
Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 09, 2021, 07:16:46 AM
>try long press home
Yes. Long press works as exit.. But it's not common way for exiting menu lists. I was hoping to have consistent way of exiting lists via simple HOME button press.

> folders should still get a folder icon though looking at the code
Nope. It's displayed as plugin for me... Though I'm not terrible concerned about icons - just an observation. Also when I tested Igor's build  (http://poretsky.homelinux.net/rockbox/)(related commit (https://github.com/poretsky/rockbox/commit/8fec06d95231cb4bf18ddf8c9caa2e10f3be534e))- icons were properly shown for apps and directories.
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 09, 2021, 07:37:16 AM
Eh thats as close as you are gonna get, the problem is that just because it works out that home is back on the clipzip it is not neccessairly
the case for another player< I toyed with making it detect which key it entered with but the issue is that that damn menu is called 3 different ways
also the quick screen uses a different mechanism based on the button instead of an action

I'll see about the exiting to WPS
and see if I can differentiate between folders and plugin that early


 
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 09, 2021, 08:28:26 AM
Ok I think that should be satisfactory
I'll get igor's patch in here next time I have a bit this week

I plan to push this out of core eventually into a plugin (where it belongs)

Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 09, 2021, 09:23:42 AM
Thanks.. Yeah it's almost perfect for me now :)
It seems you've committed some debug code. I see splashes like "3" or "b 3 GoTo.opx" before shortcut action is executed.

> the problem is that just because it works out that home is back on the clipzip it is not neccessairly the case for another player

Can't we just exit Shortucts menu for any unhandled action? I see similar inconsistent behavior on Rocker too - it's not exiting Shortcut menu on Power button
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 09, 2021, 09:42:38 AM
Oh I did leave some debug stuff in apparently -- oops

The problem with marking an action as un-handled and acting on that is that we then break devices that use multiple keys to compose an action
The action subsystem would return as unknown_action -- or I should say 'could potentially' on the first press and exit before they could select the context menu for instance

I can rework the shortcut menu to allow me more control over actions and keys but really that is a lot of extra work for a minor annoyance (for me)
Now that being said I only did the std context one and not the WPS context action but I really think this menu is flawed with all these different ways to call
it and differing exit strategies

It looks tacked on because it is and since we have voice in plugins now it should become a plugin with a better defined interface



Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 09, 2021, 10:08:10 AM
Ok got it... Thanks for the details. It was annoying to me when main menu was opened on Shortcuts Menu exit - so I had to push different buttons to return back to WPS (once Power to exit Shortcuts and then Home button to return back to WPS) Thanks to your changes WPS is only one button away now - so it's minor to me too.


Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 11, 2021, 02:01:18 PM
It seems I found a bug related to recent changes:
Start to play some music
Open Shortucts menu from WPS
Start any plugin (lrcplayer) and exit it back to WPS;
Press Select button to return to files
I see splash "Can't open" (on second attempt it works though)
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 12, 2021, 07:48:50 AM
I'm busy with something else, I'll come back to it in the next week
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 18, 2021, 12:52:38 AM
Ok should be fixed in the latest dev builds with g#3238
Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 18, 2021, 03:32:25 AM
Yep no more "Can't open" splashes. Thank you! Though one more unexpected splash for directory shortcut.  When I try to open directory shortcut I see splash "Not a plugin FolderName"
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 18, 2021, 10:08:29 AM
you sure do make a good bug tester
  :)

I'll get to it this evening
Title: Re: Shortcuts updates [Core not plugin]
Post by: Bilgus on March 18, 2021, 01:33:06 PM
fixed -- compiling now
Title: Re: Shortcuts updates [Core not plugin]
Post by: bahus on March 18, 2021, 01:51:48 PM
Just tested freshly baked build -  everything works and no splashes. Yeaah :)