delphi 修改代码补全的快捷键(由Ctrl+Space 改为 Ctrl + alt + Space)
文章来自于:https://www.cnblogs.com/lackey/p/5373761.html
delphi 的IDE快捷键与输入法切换键中突,以往的解决方法是下载一个ImeTool修改 windows 系统的快捷键
在 xp win7 都好使,但在win 10经常是修改完后,重启又失效了。
本方法采用 Open Tools API 编写是一个组件。安装方法:
菜单-->Component -->install Component 然后选择此本单元,然后就瞎折腾吧。就好了。
1 unit EagleBufferList; 2 3 interface 4 5 procedure Register; 6 7 implementation 8 9 uses Windows, Classes, SysUtils, Menus, ToolsAPI, Controls; 10 11 type 12 TBufferList = class(TNotifierObject, IUnknown, IOTANotifier, IOTAKeyboardBinding) 13 function GetBindingType: TBindingType; 14 function GetDisplayName: string; 15 function GetName: string; 16 //指定快捷键 17 procedure BindKeyboard(const BindingServices: IOTAKeyBindingServices); 18 protected 19 procedure CodeCompletion(const Context: IOTAKeyContext; KeyCode: TShortcut; var BindingResult: TKeyBindingResult); 20 end; 21 22 resourcestring 23 sBufferList = 'Eagle''s Buffer List'; 24 25 // register this key binding 26 procedure Register; 27 begin 28 (BorlandIDEServices as IOTAKeyBoardServices).AddKeyboardBinding(TBufferList.Create); 29 end; 30 31 { TBufferList } 32 33 // the code to bind key 34 procedure TBufferList.BindKeyboard(const BindingServices: IOTAKeyBindingServices); 35 begin 36 BindingServices.AddKeyBinding([ShortCut(Ord('P'), [ssShift, ssCtrl, ssAlt])], CodeCompletion, 37 Pointer(csCodeList or csManual)); 38 BindingServices.AddKeyBinding([ShortCut(Ord('O'), [ssShift, ssCtrl, ssAlt])], CodeCompletion, 39 Pointer(csParamList or csManual)); 40 BindingServices.AddKeyBinding([ShortCut(Ord(' '), [ssCtrl, ssShift])], CodeCompletion, 41 Pointer(csCodeList or csParamList or csManual)); 42 { 1,2句是原作者写的 43 3句是我加的 把代码补完快捷键 替换为 ctrl + shift + space 44 } 45 end; 46 47 // do code completion 48 procedure TBufferList.CodeCompletion(const Context: IOTAKeyContext; KeyCode: TShortcut; 49 var BindingResult: TKeyBindingResult); 50 begin 51 52 (Context.EditBuffer.TopView as IOTAEditActions).CodeCompletion(Byte(Context.Context)); 53 BindingResult := krHandled; 54 55 end; 56 57 function TBufferList.GetBindingType: TBindingType; 58 begin 59 Result := btPartial; 60 end; 61 62 function TBufferList.GetDisplayName: string; 63 begin 64 Result := sBufferList; 65 end; 66 67 function TBufferList.GetName: string; 68 begin 69 Result := 'EagleKing.BufferList'; // do not localize 70 end; 71 72 end.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?