Update of /cvsroot/synedit/SynEdit/Source
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21144
Modified Files:
Tag: UtterUnstable
SynEdit.pas
Log Message:
Don't execute CommandProcessor method if Win key is pressed or if either L-Alt or Ctrl is pressed alone.
Index: SynEdit.pas
===================================================================
RCS file: /cvsroot/synedit/SynEdit/Source/SynEdit.pas,v
retrieving revision 1.389.2.79
retrieving revision 1.389.2.80
diff -u -d -r1.389.2.79 -r1.389.2.80
--- SynEdit.pas 14 Mar 2007 04:58:57 -0000 1.389.2.79
+++ SynEdit.pas 27 Mar 2007 22:13:45 -0000 1.389.2.80
@@ -1590,6 +1590,14 @@
end;
procedure TCustomSynEdit.KeyPress(var Key: Char);
+
+ function IsKeyPressed(p_VirtualKey: Integer): Boolean;
+ const
+ KEY_PRESSED_MASK = 1 shl 31;
+ begin
+ Result := GetKeyState(p_VirtualKey) and KEY_PRESSED_MASK <> 0;
+ end;
+
begin
{$IFDEF SYN_MBCSSUPPORT}
if (fImeCount > 0) then
@@ -1603,7 +1611,16 @@
begin
inherited;
fKbdHandler.ExecuteKeyPress (Self,Key);
- CommandProcessor(ecChar, Key, nil);
+ if Key <> #0 then
+ begin
+ if not IsKeyPressed(VK_RWIN) and not IsKeyPressed(VK_LWIN)
+ and (IsKeyPressed(VK_CONTROL) = IsKeyPressed(VK_LMENU)) then
+ begin
+ CommandProcessor(ecChar, Key, nil);
+ end
+ else
+ Beep;
+ end;
end
else
// don't ignore further keys
|