• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

delphi修改代码补全的快捷键(由Ctrl+Space改为Ctrl+alt+Space)

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

delphi 的IDE快捷键与输入法切换键中突,以往的解决方法是下载一个ImeTool修改 windows 系统的快捷键

在 xp win7 都好使,但在win 10经常是修改完后,重启又失效了。

本方法采用 Open Tools API 编写是一个组件。安装方法:

菜单-->Component -->install Component 然后选择此本单元,然后就瞎折腾吧。就好了。

源码下载

D7_KeyMapping下载 XE8_KeyMapping下载

 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, ssAlt])], CodeCompletion,
41     Pointer(csCodeList or csParamList or csManual));
42   { 1,2句是原作者写的
43     3句是我加的 把代码补完快捷键 替换为 ctrl + alt + 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.
EagleBufferList.pas

附:delphi 进阶基础技能说明


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
[matlab] 14.DBSCAN 聚类发布时间:2022-07-18
下一篇:
delphi控件的停靠发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap