> On Friday 08 October 2010 01:11:02 Jack wrote:
> > richard terry a écrit :
> > >>From the docs:
> > >    If Key.Code = Key["R"] And If Key.Control Then
> > >    
> > >        Print "You hit CTRL+R"
> > >    
> > >    End If
> > > 
> > > If my hands this does the following
> > > 
> > >   Key.code = 1677724
> > >  
> > >  Key["R"]  = 82
> > > 
> > > Key.control = true
> > > 
> > > but I'm probably pressing ctrl + small r I guess:
> > > 
> > > Clearly they don't match
> > > 
> > > If I put on the capslock to ensure a capital R, results are similar.
> > > ie one long number, the small number.
> > > 
> > > 
> > > What could I be doing wrong?
> > 
> > Perhaps this code ?
> > 
> > IF key.Control THEN
> > 
> >    IF key.code = key["R"] THEN
> >     
> >     Print "You hit CTRL+R"
> >     
> >    End If
> 
>  Key.code = 1677724
> Key["R"]  = 82
> 

It works as expected with gb.qt4.

That Key.Code is the code of the CTRL key. You receive it when the CTRL key is 
pressed, not when the R key is pressed.

Note that gb.gtk makes a difference between the Key.Code of 'R' and 'r', 
whereas it should not. I will try to fix that.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to