比如把小键盘0变成直线line命令,就这么简单
- [CommandMethod("CS6")]
- public static void Main()
- {
- Acap.PreTranslateMessage -= AcapOnPreTranslateMessage;
- Acap.PreTranslateMessage += AcapOnPreTranslateMessage;
- }
- private static void AcapOnPreTranslateMessage(object sender, PreTranslateMessageEventArgs e)
- {
- if(e.Message.message!=256|| Acap.DocumentManager.MdiActiveDocument is not Document doc)
- return;
- var keys = (Keys)e.Message.wParam;
- if (keys.HasFlag(Keys.NumPad0))
- {
- doc.SendStringToExecute("\u001b_.Line\n",true,false,false);
- }
- }
|