KeyboardPriority Property (ActiveX)

Controls how AutoCAD responds to the input of coordinate data.

Supported platforms: Windows only

Signature

VBA:

object.KeyboardPriority
object

Type: PreferencesUser

The object this property applies to.

Property Value

Read-only: No

Type: acKeyboardPriority enum

Remarks

The initial value for this property is acKeyboardEntryExceptScripts.

Note: The value of this property is stored in the OSNAPCOORD system variable.

Examples

VBA:

Sub Example_KeyboardPriority()
    ' This example returns the current setting of
    ' KeyboardPriority. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currKeyboardPriority As Integer
    Dim constant As String
    Dim newConstant As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current KeyboardPriority value
    currKeyboardPriority = preferences.User.KeyboardPriority
    constant = Choose(currKeyboardPriority + 1, "acKeyboardRunningObjSnap", "acKeyboardEntry", "acKeyboardEntryExceptScripts")
    MsgBox "The current value for KeyboardPriority is " & constant, vbInformation, "KeyboardPriority Example"
    
    ' Change the value for KeyboardPriority
    newConstant = "acKeyboardEntry"
    preferences.User.KeyboardPriority = acKeyboardEntry
    MsgBox "The new value for KeyboardPriority is " & newConstant, vbInformation, "KeyboardPriority Example"
    
    ' Reset KeyboardPriority to its original value
    preferences.User.KeyboardPriority = currKeyboardPriority
    MsgBox "The KeyboardPriority value is reset to " & constant, vbInformation, "KeyboardPriority Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_KeyboardPriority()
    ;; This example returns the current setting of
    ;; KeyboardPriority. 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 KeyboardPriority value
    (setq currKeyboardPriority (vla-get-KeyboardPriority (vla-get-User preferences)))
    (setq constant (cond
                     ((= currKeyboardPriority 0) "acKeyboardRunningObjSnap")
                     ((= currKeyboardPriority 1) "acKeyboardEntry")
                     ((= currKeyboardPriority 2) "acKeyboardEntryExceptScripts")))
    (alert (strcat "The current value for KeyboardPriority is " constant))
    
    ;; Change the value for KeyboardPriority
    (setq newConstant "acKeyboardEntry")
    (vla-put-KeyboardPriority (vla-get-User preferences) acKeyboardEntry)
    (alert (strcat "The new value for KeyboardPriority is " newConstant))
    
    ;; Reset KeyboardPriority to its original value
    (vla-put-KeyboardPriority (vla-get-User preferences) currKeyboardPriority)
    (alert (strcat "The KeyboardPriority value is reset to " constant))
)