unit uChangeCodeCompletion;
interface
procedure Register;
implementation
uses Windows, Classes, SysUtils,Menus, ToolsAPI, Controls ;
type
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;
resourcestring
sBufferList = 'Szy''s Buffer List';
//register this key binding
procedure Register;
begin
(BorlandIDEServices as IOTAKeyBoardServices).AddKeyboardBinding(TBufferList.Create);
end;
{ TBufferList }
//the code to bind key
procedure TBufferList.BindKeyboard(const BindingServices: IOTAKeyBindingServices);
Begin
BindingServices.AddKeyBinding([ShortCut(VK_SPACE, [ssAlt])], CodeCompletion, Pointer(csCodeList or csManual));
end;
//do code completion
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 := sBufferList;
end;
function TBufferList.GetName: string;
begin
Result := 'Szy.BufferList';
end;
end.
把上面那个存成pas,然后兴建一个package,加入这个pas,然后install就可以了