[MPlayer-dev-eng] [PATCH] Remove osd menu hardcoded keybindings, support custom keybindings.

Ulion ulion2002 at gmail.com
Sun Dec 2 12:54:57 CET 2007


2007/12/2, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Sun, Dec 02, 2007 at 08:50:09AM +0100, Alban Bedel wrote:
> > On Sat, 1 Dec 2007 14:18:11 +0800
> > Ulion <ulion2002 at gmail.com> wrote:
> >
> > > Hello,
> > >
> > > There are keybindings in libmenu for browse osd menu, but it's
> > > hardcoded, can not be customized.
> > > This patch remove the hardcoded keybindings, and support user defined
> > > keybindings from osd menu  browsering.
> > > As we known, each input key has only one possible binding defined
> > > input.conf, such as arrow up, down, left, and right, but when browsing
> > > osd menu, you probably want to use these keys, then they are hardcoded
> > > in libmenu. But for users want to use other key to browse osd menu,
> > > there's no way to custom browsing keybindings, so I made this patch
> > > fix the problem.
> >
> > Good idea, the patch seems fine. But why do you change the read_key()
> > return type from void to int? afaict from the patch it's useless, but
> > as it's mixed changes that's hard to say. If you *realy* need to change
> > the prototype then do it in another patch.

Change read_key() to int is for the next step: left un-handled keys to
input instead of steal all of them.  Currently it can be void, I will
remove it for a clean patch.

>
> The same question applies as to why the menu_def_t typedef is removed.
> Makes me think if maybe the patch is a bi too big for what it tries to
> do and at least should be split.

That's needed by keybindings' code, current menu struct has no type
info, the typedef is moved to the header file to add the type info
into menu struct so we can get menu's type name and menu's name.
But I can split this little part as a standlone patch and apply it
first to simply the main patch code.

Here's the patch after cleanup. Other change: change menu cmd name
from macro name to lower case such like 'menu up', 'menu down'.

-- 
Ulion
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: osdmenu_custom_keybindings2.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071202/da9ef126/attachment.asc>


More information about the MPlayer-dev-eng mailing list