我已经改成Ctrl+U了。下面是代码,不算长,安装方法我就不说了,大家都是高手~
{ *************************************************************************** }
{ }
{ Delphi 的IDE代码自动完成快捷键替换程序 UnitNewKeyMap.pas }
{ }
{ wr960204(王锐) 2002-2-20 }
{ }
{ *************************************************************************** }
unit UnitNewKeyMap;
interface
uses Windows, Classes, SysUtils, Menus, ToolsAPI, Controls;
procedure Register;
implementation
type //把类写到implementation中免得不必要的访问
TBufferList = class(TNotifierObject, IUnknown, IOTANotifier,
IOTAKeyboardBinding)
function GetBindingType: TBindingType;
function GetDisplayName: string;
function GetName: string;
procedure BindKeyboard(const BindingServices: IOTAKeyBindingServices);
protected
procedure CodeCompletion(const Context: IOTAKeyContext; KeyCode: TShortcut;
var BindingResult: TKeyBindingResult);
end;
procedure Register;
begin
(BorlandIDEServices as
IOTAKeyBoardServices).AddKeyboardBinding(TBufferList.Create);
end;
procedure TBufferList.BindKeyboard(const BindingServices:
IOTAKeyBindingServices);
begin
BindingServices.AddKeyBinding([ShortCut(Ord('U'), [ssCtrl])],
CodeCompletion, Pointer(csCodeList or csManual));
end;
procedure TBufferList.CodeCompletion(const Context: IOTAKeyContext;
KeyCode: TShortcut; var BindingResult: TKeyBindingResult);
begin
(Context.EditBuffer.TopView as
IOTAEditActions).CodeCompletion(Byte(Context.Context));
BindingResult := krHandled;
end;
function TBufferList.GetBindingType: TBindingType;
begin
Result := btPartial;
end;
function TBufferList.GetDisplayName: string;
begin
Result := '代码自动完成解决方案';
end;
function TBufferList.GetName: string;
begin
Result := 'NewKeyMap';
end;
end.