Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Additional Controls/TMaskEdit    [ Add a report in this area ]  
Report #:  1459   Status: Need Feedback
TMaskEdit causes a keyboard lock on some machines and a big slowdown and blinking numlock on others
Project:  Delphi Build #:  6.0.6.240
Version:    6.0 Submitted By:   Haralabos Michael
Report Type:  Minor failure / Design problem Date Reported:  6/6/2002 3:43:05 PM
Severity:    Commonly encountered problem Last Updated: 1/19/2010 12:33:46 AM
Platform:    All versions Internal Tracking #:  
Resolution: Need More Info (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (12 Total Ratings)
2.83 out of 5
Total Votes: None
Description
See http://buglist.jrsoftware.org/generated/entry0326.htm for details
Steps to Reproduce:
None
Workarounds
None
Attachment
None
Comments

Jeroen Pluimers at 6/19/2002 4:04:59 AM -
On that site, this fix is available:

Stefan Hoffmeister came up with this:
The following is the proposed solution to the TMaskEdit problem you are listing for Delphi 1. It has been posted on the newsgroups by many people and I really cannot point to the original authors. As I have never seen the problem MYSELF I cannot say whether the solution actually fixes the problem - the posters do claim though that this is the case. Since publication of the fix (below), reports have been received that it does fix the problem (RPS)
Solution:
One fix could be to change the VCL source code in MASK.PAS according to the following example:

procedure TCustomMaskEdit.SetCursor(Pos: Integer);
var
...
begin
...
    SetSel(SelStop, SelStop);

    if SelStart <> SelStop then
    begin
      GetKeyboardState(KeyState);

{$IFDEF FixMaskEdit}
      NewKeyState := KeyState;
{$ELSE}
      for I := Low(NewKeyState) to High(NewKeyState) do
        NewKeyState[I] := 0;
{$ENDIF}
      NewKeyState [VK_SHIFT] := $81;
      NewKeyState [VK_LEFT] := $81;
      SetKeyboardState(NewKeyState);
...
David S. Becker (dsb@plaza.ds.adp.com) has another fix for the same problem:
      GetKeyboardState(KeyState);
{$IFDEF FixMaskEdit}
      NewKeyState := KeyState;
      NewKeyState[VK_CONTROL] := $00;  { Up }
      NewKeyState[VK_MENU] := $00;  { Up - ALT key }
      NewKeyState[VK_SHIFT] := $80;  { Down }
      NewKeyState[VK_LEFT] := $80;  { Down }
{$ELSE}
      for I := Low(NewKeyState) to High(NewKeyState) do
        NewKeyState[I] := 0;
      NewKeyState [VK_SHIFT] := $81;
      NewKeyState [VK_LEFT] := $81;
{$ENDIF}
      SetKeyboardState(NewKeyState);

Now, the fixes given above are only useful to people who are able to recompile MASK.PAS. However, many people can't do that and have asked how the could obtain a fixed MASK.DCU.
To meet those requests, here's a copy you can download: mask.dcu; accompanied by a text file with instructions: mask.txt.

Jeroen Pluimers at 6/19/2002 4:06:25 AM -
14088  2839689

Server Response from: ETNACODE01