CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2023 开发者帮助

KeyboardAccelerator 属性 (ActiveX)

2024-5-18 18:57| 发布者: admin| 查看: 114| 评论: 0|原作者: admin|来自: AutoCAD

KeyboardAccelerator 属性 (ActiveX)

指定 Windows 标准键盘或 AutoCAD 经典键盘。

支持的平台:仅限 Windows

签名

VBA:

object.KeyboardAccelerator
对象

类型:PreferencesUser

此属性应用于的对象。

属性值

只读:

类型:枚举acKeyboardAccelerator

  • acPreferenceClassic:使用 AutoCAD 经典键盘。
  • acPreferenceCustom:使用 Windows 标准键盘。

言论

没有其他评论。

例子

VBA:

Sub Example_KeyboardAccelerator()
    ' This example returns the current setting of
    ' KeyboardAccelerator. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currKeyboardAccelerator As Integer
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current KeyboardAccelerator value
    currKeyboardAccelerator = preferences.User.KeyboardAccelerator
    MsgBox "The current value for KeyboardAccelerator is " & currKeyboardAccelerator, vbInformation, "KeyboardAccelerator Example"
    
    ' Change the value for KeyboardAccelerator
    If currKeyboardAccelerator = acPreferenceClassic Then
        preferences.User.KeyboardAccelerator = acPreferenceCustom
    Else
        preferences.User.KeyboardAccelerator = acPreferenceClassic
    End If
    MsgBox "The new value for KeyboardAccelerator is " & preferences.User.KeyboardAccelerator, vbInformation, "KeyboardAccelerator Example"
    
    ' Reset KeyboardAccelerator to its original value
    preferences.User.KeyboardAccelerator = currKeyboardAccelerator
    MsgBox "The KeyboardAccelerator value is reset to " & preferences.User.KeyboardAccelerator, vbInformation, "KeyboardAccelerator Example"
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_KeyboardAccelerator()
    ;; This example returns the current setting of
    ;; KeyboardAccelerator. It then changes the value, and finally
    ;; it resets the value back to the original setting.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Retrieve the current KeyboardAccelerator value
    (setq currKeyboardAccelerator (vla-get-KeyboardAccelerator (vla-get-User preferences)))
    (alert (strcat "The current value for KeyboardAccelerator is " (if (= currKeyboardAccelerator acPreferenceClassic) "Classic" "Custom")))
    
    ;; Change the value for KeyboardAccelerator
    (if (= currKeyboardAccelerator acPreferenceClassic)
        (vla-put-KeyboardAccelerator (vla-get-User preferences) acPreferenceCustom)
        (vla-put-KeyboardAccelerator (vla-get-User preferences) acPreferenceClassic)
    )
  
    (alert (strcat "The new value for KeyboardAccelerator is " (if (= (vla-get-KeyboardAccelerator (vla-get-User preferences)) acPreferenceClassic) "Classic" "Custom")))
    
    ;; Reset KeyboardAccelerator to its original value
    (vla-put-KeyboardAccelerator (vla-get-User preferences) currKeyboardAccelerator)
    (alert (strcat "The KeyboardAccelerator value is reset to " (if (= (vla-get-KeyboardAccelerator (vla-get-User preferences)) acPreferenceClassic) "Classic" "Custom")))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1   苏公网安备32011402011833)

GMT+8, 2025-1-19 07:28

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部