Mailinglist Archive: yast-devel (101 mails)

< Previous Next >
[yast-devel] YCP: how to permanently bind the Enter key to a PushButton?
  • From: Johannes Meixner <jsmeix@xxxxxxx>
  • Date: Wed, 20 Jan 2010 11:39:08 +0100 (CET)
  • Message-id: <alpine.LNX.2.00.1001201121360.18166@xxxxxxxxxxxxxx>

Hello,

I like to permanently bind the Enter key to a PushButton.

Currently I have in source/printer/src/basicadd.ycp
---------------------------------------------------------------
`HBox
( `PushButton
( `id(`apply_driver_filter),
`opt(`default),
_("&Search for")
),
`InputField
( `id(`driver_filter_input),
---------------------------------------------------------------

I use `opt(`default) because this button must be the default
so that it is activated when the user pressed the Enter key
because when the user has clicked into the InputField
to enter a search string, it is normal to finish entering
by pressing the Enter key but if the Enter key was linked
to 'Next' or 'Back' (which is the default), the user would get
the wrong action.

Unfortunately `opt(`default) does not work here.

I assume whatever Wizard::... function call afterwards
invalids this `opt(`default) and re-sets the default
back to 'Next' or 'Back'.

Therefore I added in source/printer/src/basicadd.ycp
---------------------------------------------------------------
any user_input = nil;
while( true )
{ UI::SetFocus( `apply_driver_filter );
user_input = UI::UserInput();
---------------------------------------------------------------
as an attempt to re-set the default to my button
but this does not help. My button has initially the focus
but after the user had clicked into the InputField
to enter a search string, the focus is of course gone
and the Enter key is not linked to my button.

Therefore my question how to _permanently_ bind
the Enter key to a PushButton?


Kind Regards
Johannes Meixner
--
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups