View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0016699||Lazarus||Widgetset||public||2010-06-11 10:03||2011-12-01 11:24|
|Reporter||John vd Waeter||Assigned To||Felipe Monteiro de Carvalho|
|Product Version||0.9.29 (SVN)||Product Build|
|Target Version||Fixed in Version||0.9.29 (SVN)|
|Summary||0016699: WinCE: On Smartphone the Back-key is not treated as Backspace in TEdit|
|Description||On smartphone (keyboarddevice) the back-key should be captured when TEdit has focus and be treated like backspace. Instead it closes the active form.|
tested on both WM 5.0 and WM6.x smartphone emulators.
|Tags||No tags attached.|
|Fixed in Revision||26841|
I did some searching and it seams that the hardware back key should send a VK_ESCAPE key. It doesn't, however, generate any KeyDown or KeyUp event ... strange. Maybe we need to set a global handler for it? (if they exist on WinCE)
From what I've read people also have trouble with this using the CF.NET
Also, in my WM 5 Emulator the back key doesn't close my main form.
Weird, in my smartphone emulators, both wm5.0 and wm6.5, it does close the current form... well, it does not close it, it hides the form.
If it does send a VK_ESCAPE then maybe the form picks it up as a "hide"? If the form is a bsdialog, that is normal behaviour, but I have borderstyle=bsSizeable .
I tried to use the forms Keypreview and onKeyDown, but the key is not captured. In fact I cannot capture any key on the form.
Not in pocket-pc emulator either.
Looks like the code from skoro here
solves the matter, but only per form. And for some unknown reason this code has influence on fontsizes???? Fontsizes differ a lot when this code is activated or not.
||The calling convention is wrong, it's a surprise it doesn't crash. Could you test that code over there using "cdecl" as the calling convention and check if it still has the bad side effects?|
With cdecl convention, the backspace-key works ok.
The size-effect is the same.
It was not specific fontsize. Inside the forms oncreate-event I derived my forms initial self.font.size from the forms height, like font.size:=self.height div 20;
WITH skoro's code, self.height gives me the run-time formheight.
WITHOUT skoro's code, it gives me the design-time height. Skoro's code is executed before reading self.height. It looks like this code also triggers sizing of the form, which is set alClient.
I know I probably should not rely on formheight in the stage of formcreation, but I don't understand why skoro's code has this side-effect, as it looks to me it just overrides VK_ESCAPE which I think has nothing to do with formsizing?
Ah, just put your code in OnResize or else use Screen.Height which doesn't change. It's the nature of PDAs that the form size can change. In some Android phones it changes just by the way you hold the device, because it responds to the gravity and will change the GUI to be horizontal or vertical.
What I really wanted to know is if it breaks ShowModal as stated in the forum.
||Showmodal seems to work Ok here with skoro's code. No difference if cdecl or stdcall is used. Perhaps Skoro can eloborate what goes wrong? I'll ask in the forum.|
||Fixed, but note that it only works if you have a menu, and it is really like that. I don't see how to make it work without a menu as the menu converts the hardware key into a message.|
|2010-06-11 10:03||John vd Waeter||New Issue|
|2010-06-11 10:03||John vd Waeter||Widgetset||=> WinCE|
|2010-06-11 11:27||Felipe Monteiro de Carvalho||Status||new => assigned|
|2010-06-11 11:27||Felipe Monteiro de Carvalho||Assigned To||=> Felipe Monteiro de Carvalho|
|2010-06-23 10:37||Felipe Monteiro de Carvalho||Note Added: 0038759|
|2010-06-23 12:22||John vd Waeter||Note Added: 0038763|
|2010-07-23 15:25||John vd Waeter||Note Added: 0039614|
|2010-07-23 18:15||Felipe Monteiro de Carvalho||Note Added: 0039625|
|2010-07-23 19:01||John vd Waeter||Note Added: 0039629|
|2010-07-24 14:20||Felipe Monteiro de Carvalho||Note Added: 0039658|
|2010-07-24 14:44||John vd Waeter||Note Added: 0039659|
|2010-07-26 17:10||Felipe Monteiro de Carvalho||Fixed in Revision||=> 26841|
|2010-07-26 17:10||Felipe Monteiro de Carvalho||LazTarget||=> -|
|2010-07-26 17:10||Felipe Monteiro de Carvalho||Status||assigned => resolved|
|2010-07-26 17:10||Felipe Monteiro de Carvalho||Fixed in Version||=> 0.9.29 (SVN)|
|2010-07-26 17:10||Felipe Monteiro de Carvalho||Resolution||open => fixed|
|2010-07-26 17:10||Felipe Monteiro de Carvalho||Note Added: 0039705|
|2010-10-21 07:55||Felipe Monteiro de Carvalho||Relationship added||related to 0017667|
|2011-12-01 11:24||Marc Weustink||Status||resolved => closed|