Key.Text is not guaranteed to be set during a KeyRelease.
(Do you means readed? Ok, you are look at from compiler dev perspective.
Right?)
Why it's in that way?
Because Qt loses some information needed by the KeyRelease event when some
compound keys are used.
--
Benoît Minisini
2010/4/14 Benoît Minisini gam...@users.sourceforge.net:
Key.Text is not guaranteed to be set during a KeyRelease.
But, refering to the values provided by the key class, is guaranted
their availability within the routines that are called from KeyPress?
Why it's in that way?
Because Qt loses
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
Confirmed with Gambas 2.20 rev 2890 @ Ubuntu 9.10 64bit.
Thanks Jussi.
In my tests the first set results corresponds to gb.gtk (erroneously I
indicated gb.qt)
--
Fabián Flores Vadell
www.speedbooksargentina.blogspot.com
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
I wasn't very accurate... I couldn't reproduce random missed events either.
Just missing Key.Code.
I think that Key.Text behaviour should be consistent between GTK+ and Qt.
Jussi
2010/4/13 Benoît Minisini gam...@users.sourceforge.net:
Using Gambas 2.20, Ubuntu 9.10 with KDE 4.3.5 and GTK+
Key.Text is not guaranteed to be set during a KeyRelease.
(Do you means readed? Ok, you are look at from compiler dev perspective. Right?)
Why it's in that way?
Result Test (gb.qt)
I think you meant gb.gtk instead.
Yes.
Issues in two real proyects (I'm trying to isolate the problem):
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