Andras,

Ok, so for a new shortcut...
jpos.xml
<prop name="key.VK_F1+SHIFT" type="String" value="297"/>

buttonevents.xml
<button-events>
<!-- numeric button events -->
<event button-name="numOne" class-
name="org.ofbiz.pos.event.NumericEvents" method-name="triggerOne"
disable-lock="true"/>
<event button-name="numOne" key-code="297" class-
name="org.ofbiz.pos.event.NumericEvents" method-name="triggerOne"
disable-lock="true"/>

So now pressing SHIFT+F1 triggers the triggerOne method.

- Andrew


value attribute, I think is an arbitrary integer, perhaps someone else
can confirm



On Sun, 2007-02-11 at 16:16 +0100, Imre András Róbert wrote:
> Ok, I got it, I see Enter is defined with code 500.
> 
> Now how can I define a code for Alt+G?
> 
> And how can I get the 'default' codes which are not
> specified in jpos.xml? E.g. what happens when I press '1'
> for which there is no code in jpos.xml?
> 
> 
> Thanks,
>   András
> 
> 
> Sunday, February 11, 2007, 11:33:33 AM, you wrote:
> 
> > Andras,
> 
> > Look at the mapping for the Enter key.
> 
> > - Andrew
> 
> > On Sun, 2007-02-11 at 01:39 +0100, Imre András Róbert wrote:
> >> Hi,
> >> 
> >> I'd like to define shortcut keys for product buttons.
> >> For example, pressing Alt+G would act as pressing the
> >> button GIZMO 1. This would enhance usability.
> >> 
> >> Doc comments in Keyboard.java tell me that key to code
> >> mapping is in jpos.xml, and code to button mapping is
> >> in buttonevents.xml.
> >> 
> >> numeric.xml tells me widget id (numOne) and widget text (1)
> >> 
> >> buttonevents.xml tells me widget id (numOne) and handler (triggerOne
> >> method of org.ofbiz.pos.event.NumericEvents)
> >> 
> >> I still dont see the code to button mapping as the doc comment
> >> indicates in Keyboard.java.
> >> 
> >> Q1/ It seems to me that jpos.xml contains only additional
> >> key to code bindings. Where are the other codes? E.g.
> >> what happens when I press '1'?
> >> 
> >> Q2/ I dont see any codes in buttonevents.xml. Where is
> >> the code to button mapping?
> >> 
> >> Q3/ Is there a dtd/schema available for these XUI cfg
> >> files? (Would help to assess the capability of these
> >> configs instead of making guesses based on gathered
> >> cfg files)
> >> 
> >> 
> >> Thanks,
> >>   András
> >> 
> >> 
> 
-- 
Kind Regards
Andrew Sykes <[EMAIL PROTECTED]>
Sykes Development Ltd
http://www.sykesdevelopment.com

Reply via email to