KeyboardAccelerator プロパティ(ActiveX)

Windows 標準か AutoCAD クラシック キーボードかを指定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.KeyboardAccelerator
object

タイプ: PreferencesUser

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: いいえ

タイプ: acKeyboardAccelerator 列挙型

注意

追加の注意はありません。

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

Visual 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")))
)