[Gambas-user] There are errors in the class "Key", and in the events KeyPress / KeyRelease?

Jussi Lahtinen jussi.lahtinen at ...626...
Tue Apr 13 15:39:55 CEST 2010


Confirmed with Gambas 2.20 rev 2890 @ Ubuntu 9.10 64bit.

With GTK+:
KeyPress, Key.Code: 0 Key.Text: a
KeyRealease, Key.Code: 97 Key.Text: a

With Qt:
KeyPress, Key.Code: 65 Key.Text: a
KeyRealease, Key.Code: 65 Key.Text:  <-- BTW, there seems to be space.


Code used for test:
PUBLIC SUB TextBox1_KeyPress()
 PRINT "KeyPress, Key.Code: " & Key.Code & " Key.Text: " & Key.Text
END

PUBLIC SUB TextBox1_KeyRelease()
 PRINT "KeyRealease, Key.Code: " & Key.Code & " Key.Text: " & Key.Text
END

Jussi



2010/4/13 Fabián Flores Vadell <fabianfloresvadell at ...626...>:
> Using Gambas 2.20, Ubuntu 9.10 with KDE 4.3.5 and GTK+ libraries
>
> Key.Code is not returned? Key.Text is lost? KeyRelease is not raised?
>
> Put a TextBox in a Form, then write the code to catch the pressed key.
> Run it and press a number o letter key.
>
> PUBLIC SUB TextBox1_KeyPress()
>  PRINT Key.Code
>  PRINT Key.Text
> END
>
> PUBLIC SUB TextBox1_KeyRelease()
>  PRINT Key.Code
>  PRINT Key.Text
> END
>
> Result Tests (gb.qt)
> ----------------------------
>
> pressed the '5' key
>
> KeyPress: Key.Code = 53, Key.Text = "5"
>
> KeyRelease: Key.Code = 53, Key.Text = ""
>
> Randomly KeyRelease wasn't raised.
>
>
> Result Test (gb.qt)
> --------------------------
>
> pressed the '5' key
>
> KeyPress: Key.Code = 0, Key.Text = "5"
>
> KeyRelease: Key.Code = 53, Key.Text = "5"
>
> Randomly KeyRelease wasn't raised.
>
>
> Issues in two real proyects (I'm trying to isolate the problem):
> ---------------------------------------
>
> KeyPress never is raised when gb.gtk is used.
>
> KeyPress sometimes is not raised when gb.qt is used.
>
> Key.Text is lost when the event KeyRelease is raised.
>
> --
> Fabián Flores Vadell
> www.speedbooksargentina.blogspot.com
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list