View Issue Details

IDProjectCategoryView StatusLast Update
0009394LazarusLCLpublic2009-11-29 22:45
ReporterValdas Jankūnas Assigned ToMarc Weustink  
Status closedResolutionfixed 
Platformi386 32bitOSkUbuntu 
Product Version0.9.23 (SVN) 
Target Version1.0.0Fixed in Version0.9.27 (SVN) 
Summary0009394: Keyboard Alt shift state differs in KeyDown/Up events
Description Shift state for Alt key differs from Ctrl and Shift keys.
 If i press only Shift or Ctrl or Alt key then in OnKeyDown i get:

 (ssShift in Shift)=True for Shift key, and
 (ssCtrl in Shift)=True for Ctrl key, and
 (ssAlt in Shift)=False for Alt key.

 And if i release that key then in OnKeyUp i get:

 (ssShift in Shift)=False for Shift key, and
 (ssCtrl in Shift)=False for Ctrl key, and
 (ssAlt in Shift)=True for Alt key.

 And that make another question: when i press Alt or Shift or Ctrl key then that key should be included in shift state in OnKeyDown (and excluded in OnKeyUp)?

 I also uploaded test app.
TagsNo tags attached.
Fixed in Revision20767
WidgetsetGTK, GTK 2
Attached Files


2007-08-06 20:01 (2,673 bytes)

Gerard V

2007-08-10 10:15

reporter   ~0014066

The only "strange" thing I see is:
- After pressing Ctrl only or Shift only, the label is updated immediatly.
After pressing Alt, there is a slight delay before updating the label, as if the keyboard handler was waiting for another key before sending the message. So pressing Alt only and releasing the key quickly sometimes does nothing.
- After pressing Alt for a moment (a few seconds), I always get the right message, but the keybaord handler seems to "eat" the following keys, until i press Alt again or I click on the form.
When releasing the key, all Shift, Alt and Ctrl appear to be false.
I've tested the app with Delphi 7, and it works exactly in the same way, so to me it all looks normal.
(Win XP Spanish SP2)
Is there something I am missing?

Gerard V

2007-08-10 10:16

reporter   ~0014067

<shame> Yes It looks like I missed it was about GTK. </shame>

Marc Weustink

2009-06-30 00:54

administrator   ~0028864

Implemented own way of tracking shiftstates, now ssAlt is reported when pressed, similar to delphi

Valdas Jankūnas

2009-07-01 16:05

reporter   ~0028892

Now (Laz rev 20773, fpc ver 2.2.4) when I first press SHIFT key and then press ALT key then in OnKeyDown i get (ssAlt in Shift)=False, also I get False in OnKeyUp when I release ALT key. Not good.
 Also appeared another problem: first press ALT, then press SHIFT, then release ALT, ant then release SHIFT. After this sequence when I press or release any another key then in OnKeyDown or OnKeyUp events (ssAlt in Shift) always reported as True.
 I tested this in Kubuntu 9.04 (updated) with KDE 4.2.4, also in Arch 2009.02 (updated) with xfce runing as guest OS in VirtualBox ver 2.2.4.
 These two problems not appeared in Laz rev 20700 (quick choose).

 Combination CTRL + ALT works OK in fixed rev.

Valdas Jankūnas

2009-11-29 01:42

reporter   ~0032569

Last edited: 2009-11-29 02:55

No problems in gtk2 (Lazarus r22855, Kubuntu 9.10 32bit). Cannot test in gtk1, because lack of needed packages (libglib, ...) in repo

Vincent Snijders

2009-11-29 13:14

manager   ~0032572

Thanks for retesting with gtk2.

No need to test with gtk1 after:

Valdas Jankūnas

2009-11-29 16:57

reporter   ~0032576

I must Close this bug or leave as is?

Vincent Snijders

2009-11-29 19:58

manager   ~0032579

Please, close.

If you want it to be fixed for gtk1, open a new issue for gtk1 *with* patch.

Issue History

Date Modified Username Field Change
2007-08-06 20:01 Valdas Jankūnas New Issue
2007-08-06 20:01 Valdas Jankūnas File Added:
2007-08-06 20:01 Valdas Jankūnas Widgetset => GTK
2007-08-06 21:29 Vincent Snijders LazTarget => 1.0
2007-08-06 21:29 Vincent Snijders Status new => acknowledged
2007-08-10 10:15 Gerard V Note Added: 0014066
2007-08-10 10:16 Gerard V Note Added: 0014067
2008-04-24 09:57 Vincent Snijders Target Version => 1.0.0
2009-06-30 00:54 Marc Weustink Fixed in Revision => 20767
2009-06-30 00:54 Marc Weustink Widgetset GTK => GTK, GTK 2
2009-06-30 00:54 Marc Weustink Status acknowledged => resolved
2009-06-30 00:54 Marc Weustink Resolution open => fixed
2009-06-30 00:54 Marc Weustink Assigned To => Marc Weustink
2009-06-30 00:54 Marc Weustink Note Added: 0028864
2009-06-30 00:55 Marc Weustink Fixed in Version => 0.9.27 (SVN)
2009-07-01 16:05 Valdas Jankūnas Status resolved => assigned
2009-07-01 16:05 Valdas Jankūnas Resolution fixed => reopened
2009-07-01 16:05 Valdas Jankūnas Note Added: 0028892
2009-11-29 01:42 Valdas Jankūnas Note Added: 0032569
2009-11-29 02:55 Valdas Jankūnas Note Edited: 0032569
2009-11-29 13:14 Vincent Snijders Status assigned => resolved
2009-11-29 13:14 Vincent Snijders Resolution reopened => fixed
2009-11-29 13:14 Vincent Snijders Note Added: 0032572
2009-11-29 16:57 Valdas Jankūnas Note Added: 0032576
2009-11-29 19:58 Vincent Snijders Note Added: 0032579
2009-11-29 22:45 Valdas Jankūnas Status resolved => closed