Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xkeyboard WIP #100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions clx.asd
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ Independent FOSS developers"
:components
((:file "shape")
(:file "big-requests")
(:file "xkb-keysymdef")
(:file "xkb-constants")
(:file "xkb-types")
(:file "xkb-structs")
(:file "xkeyboard"
:depends-on ("xkb-keysymdef"
"xkb-constants"
"xkb-types"
"xkb-structs"))
(:file "xvidmode")
(:xrender-source-file "xrender")
(:file "glx")
Expand Down
302 changes: 302 additions & 0 deletions extensions/xkb-constants.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@

(in-package :xlib)
;;; XKeyboard opcodes
(defconstant +use-extension+ 0)
(defconstant +select-events+ 1)
(defconstant +bell+ 3)
(defconstant +get-state+ 4)
(defconstant +latch-lock-state+ 5)
(defconstant +get-controls+ 6)
(defconstant +set-controls+ 7)
(defconstant +get-map+ 8)
(defconstant +set-map+ 9)
(defconstant +get-compat-map+ 10)
(defconstant +set-compat-map+ 11)
(defconstant +get-indicator-state+ 12)
(defconstant +get-indicator-map+ 13)
(defconstant +set-indicator-map+ 14)
(defconstant +get-named-indicator+ 15)
(defconstant +set-named-indicator+ 16)
(defconstant +get-names+ 17)
(defconstant +set-names+ 18)
(defconstant +get-geometry+ 19)
(defconstant +set-geometry+ 20)
(defconstant +per-client-flags+ 21)
(defconstant +list-components+ 22)
(defconstant +get-kbd-by-name+ 23)
(defconstant +get-device-info+ 24)
(defconstant +set-device-info+ 25)
(defconstant +set-debugging-flags+ 101)

;;; Enum Constants
(defconstant +new-keyboard-notify+ #x0001)
(defconstant +map-notify+ #x0002)
(defconstant +state-notify+ #x0004)
(defconstant +controls-notify+ #x0008)
(defconstant +indicator-state-notify+ #x0010)
(defconstant +indicator-map-notify+ #x0020)
(defconstant +names-notify+ #x0040)
(defconstant +compat-map-notify+ #x0080)
(defconstant +bell-notify+ #x0100)
(defconstant +action-message+ #x0200)
(defconstant +access-xnotify+ #x0400)
(defconstant +extension-device-notify+ #x0800)

(defconstant +NKN_Keycodes+ #x01)
(defconstant +NKN_Geometry+ #x02)
(defconstant +NKN_DeviceID+ #x04)
(defconstant +AXN_SKPress+ #x01)
(defconstant +AXN_SKAccept+ #x02)
(defconstant +AXN_SKReject+ #x04)
(defconstant +AXN_SKRelease+ #x08)
(defconstant +AXN_BKAccept+ #x10)
(defconstant +AXN_BKReject+ #x20)
(defconstant +AXN_AXKWarning+ #x40)

;SETofKB_MAPPART
(defconstant +KeyTypes+ #x0001)
(defconstant +KeySyms+ #x0002)
(defconstant +ModifierMap+ #x0004)
(defconstant +ExplicitComponents+ #x0008)
(defconstant +KeyActions+ #x0010)
(defconstant +KeyBehaviors+ #x0020)
(defconstant +VirtualMods+ #x0040)
(defconstant +VirtualModMap+ #x0080)

;SETofKEYMASK clx never explicitly defines them
(defconstant +shift+ #x0001)
(defconstant +lock+ #x0002)
(defconstant +control+ #x0004)
(defconstant +mod1+ #x0008)
(defconstant +mod2+ #x0010)
(defconstant +mod3+ #x0020)
(defconstant +mod4+ #x0040)
(defconstant +mod5+ #x0080)

(defconstant +ModifierState+ #x0001)
(defconstant +ModifierBase+ #x0002)
(defconstant +ModifierLatch+ #x0004)
(defconstant +ModifierLock+ #x0008)
(defconstant +GroupState+ #x0010)
(defconstant +GroupBase+ #x0020)
(defconstant +GroupLatch+ #x0040)
(defconstant +GroupLock+ #x0080)
(defconstant +CompatState+ #x0100)
(defconstant +GrabMods+ #x0200)
(defconstant +CompatGrabMods+ #x0400)
(defconstant +LookupMods+ #x0800)
(defconstant +CompatLookupMods+ #x1000)
(defconstant +PointerButtons+ #x2000)
(defconstant +RepeatKeys+ #x00000001)
(defconstant +SlowKeys+ #x00000002)
(defconstant +BounceKeys+ #x00000004)
(defconstant +StickyKeys+ #x00000008)
(defconstant +MouseKeys+ #x00000010)
(defconstant +MouseKeysAccel+ #x00000020)
(defconstant +AccessXKeys+ #x00000040)
(defconstant +AccessXTimeoutMask+ #x00000080)
(defconstant +AccessXFeedbackMask+ #x00000100)
(defconstant +AudibleBellMask+ #x00000200)
(defconstant +Overlay1Mask+ #x00000400)
(defconstant +Overlay2Mask+ #x00000800)
(defconstant +IgnoreGroupLockMask+ #x00001000)
(defconstant +RepeatKeys+ #x00000001)
(defconstant +SlowKeys+ #x00000002)
(defconstant +BounceKeys+ #x00000004)
(defconstant +StickyKeys+ #x00000008)
(defconstant +MouseKeys+ #x00000010)
(defconstant +MouseKeysAccel+ #x00000020)
(defconstant +AccessXKeys+ #x00000040)
(defconstant +AccessXTimeoutMask+ #x00000080)
(defconstant +AccessXFeedbackMask+ #x00000100)
(defconstant +AudibleBellMask+ #x00000200)
(defconstant +Overlay1Mask+ #x00000400)
(defconstant +Overlay2Mask+ #x00000800)
(defconstant +IgnoreGroupLockMask+ #x00001000)
(defconstant +GroupsWrap+ 27)
(defconstant +InternalMods+ 28)
(defconstant +IgnoreLockMods+ 29)
(defconstant +PerKeyRepeat+ 30)
(defconstant +ControlsEnabled+ 31)
(defconstant +AX_SKPressFB+ #x0001)
(defconstant +AX_SKAcceptFB+ #x0002)
(defconstant +AX_FeatureFB+ #x0004)
(defconstant +AX_SlowWarnFB+ #x0008)
(defconstant +AX_IndicatorFB+ #x0010)
(defconstant +AX_StickyKeysFB+ #x0020)
(defconstant +AX_SKReleaseFB+ #x0100)
(defconstant +AX_SKRejectFB+ #x0200)
(defconstant +AX_BKRejectFB+ #x0400)
(defconstant +AX_DumbBell+ #x0800)
(defconstant +AX_TwoKeys+ #x0040)
(defconstant +AX_LatchToLock+ #x0080)
(defconstant +AX_SKPressFB+ #x0001)
(defconstant +AX_SKAcceptFB+ #x0002)
(defconstant +AX_FeatureFB+ #x0004)
(defconstant +AX_SlowWarnFB+ #x0008)
(defconstant +AX_IndicatorFB+ #x0010)
(defconstant +AX_StickyKeysFB+ #x0020)
(defconstant +AX_TwoKeys+ #x0040)
(defconstant +AX_LatchToLock+ #x0080)
(defconstant +AX_SKReleaseFB+ #x0100)
(defconstant +AX_SKRejectFB+ #x0200)
(defconstant +AX_BKRejectFB+ #x0400)
(defconstant +AX_DumbBell+ #x0800)

(defconstant +kbd-feedback-class+ 0)
(defconstant +led-feedback-class+ 4)
(defconstant +kbd-feedback-class+ 0)
(defconstant +led-feedback-class+ 4)

(defconstant +DfltXIClass+ #x0300)
(defconstant +AllXIClasses+ #x0500)
(defconstant +KbdFeedbackClass+ 0)
(defconstant +BellFeedbackClass+ 5)
(defconstant +KbdFeedbackClass+ 0)
(defconstant +BellFeedbackClass+ 5)
(defconstant +DfltXIClass+ #x0300)
(defconstant +DfltXIId+ #x0400)
(defconstant +DfltXIId+ #x0400)
(defconstant +XINone+ #xff00)
(defconstant +DfltXIId+ #x0400)
(defconstant +AllXIIds+ #x0500)

(defconstant +group1+ 0)
(defconstant +group2+ 1)
(defconstant +group3+ 2)
(defconstant +group4+ 3)
(defconstant +group1+ 0)
(defconstant +group2+ 1)
(defconstant +group3+ 2)
(defconstant +group4+ 3)

(defconstant +any-group+ 254)
(defconstant +all-groups+ 255)
(defconstant +wrap-into-range+ #x00)
(defconstant +clamp-into-range+ #x40)
(defconstant +redirect-into-range+ #x80)
;; (defconstant +virtual_modifier_15+ #x80)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why these constants are commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure... I've removed them for now.

;; (defconstant +virtual_modifier_14+ #x40)
;; (defconstant +virtual_modifier_13+ #x20)
;; (defconstant +virtual_modifier_12+ #x10)
;; (defconstant +virtual_modifier_11+ #x08)
;; (defconstant +virtual_modifier_10+ #x04)
;; (defconstant +virtual_modifier_9+ #x02)
;; (defconstant +virtual_modifier_8+ #x01)
;; (defconstant +virtual_modifier_7+ #x80)
;; (defconstant +virtual_modifier_6+ #x40)
;; (defconstant +virtual_modifier_5+ #x20)
;; (defconstant +virtual_modifier_4+ #x10)
;; (defconstant +virtual_modifier_3+ #x08)
;; (defconstant +virtual_modifier_2+ #x04)
;; (defconstant +virtual_modifier_1+ #x02)
;; (defconstant +virtual_modifier_0+ #x01)
;; (defconstant +virtual_modifier_15+ #x8000)
;; (defconstant +virtual_modifier_14+ #x4000)
;; (defconstant +virtual_modifier_13+ #x2000)
;; (defconstant +virtual_modifier_12+ #x1000)
;; (defconstant +virtual_modifier_11+ #x0800)
;; (defconstant +virtual_modifier_10+ #x0400)
;; (defconstant +virtual_modifier_9+ #x0200)
;; (defconstant +virtual_modifier_8+ #x0100)
;; (defconstant +virtual_modifier_7+ #x0080)
;; (defconstant +virtual_modifier_6+ #x0040)
;; (defconstant +virtual_modifier_5+ #x0020)
;; (defconstant +virtual_modifier_4+ #x0010)
;; (defconstant +virtual_modifier_3+ #x0008)
;; (defconstant +virtual_modifier_2+ #x0004)
;; (defconstant +virtual_modifier_1+ #x0002)
;; (defconstant +virtual_modifier_0+ #x0001)
(defconstant +explicit-vmod-map+ #x80)
(defconstant +explicit-behavior+ #x40)
(defconstant +explicit-auto-repeat+ #x20)
(defconstant +explicit-interpret+ #x10)
(defconstant +explicit-key-type4+ #x08)
(defconstant +explicit-key-type3+ #x04)
(defconstant +explicit-key-type2+ #x02)
(defconstant +explicit-key-type1+ #x01)

(defconstant +IM_NoExplicit+ #x80)
(defconstant +IM_NoAutomatic+ #x40)
(defconstant +IM_LEDDrivesKB+ #x20)
(defconstant +IM_UseCompat+ #x10)
(defconstant +IM_UseEffective+ #x08)
(defconstant +IM_UseLocked+ #x04)
(defconstant +IM_UseLatched+ #x02)
(defconstant +IM_UseBase+ #x01)
(defconstant +IM_UseCompat+ #x10)
(defconstant +IM_UseEffective+ #x08)
(defconstant +IM_UseLocked+ #x04)
(defconstant +IM_UseLatched+ #x02)
(defconstant +IM_UseBase+ #x01)
(defconstant +SymInterp+ #x01)
(defconstant +GroupCompat+ #x02)

(defconstant +keycodes-name+ #x0001)
(defconstant +geometry-name+ #x0002)
(defconstant +symbols-name+ #x0004)
(defconstant +phys-symbols-name+ #x0008)
(defconstant +types-name+ #x0010)
(defconstant +compat-name+ #x0020)
(defconstant +key-type-names+ #x0040)
(defconstant +ktlevel-names+ #x0080)
(defconstant +indicator-names+ #x0100)
(defconstant +key-names+ #x0200)
(defconstant +key-aliases+ #x0400)
(defconstant +virtual-mod-names+ #x0800)
(defconstant +group-names+ #x1000)
(defconstant +rgnames+ #x2000)

(defconstant +GBN_Types+ #x01)
(defconstant +GBN_CompatMap+ #x02)
(defconstant +GBN_ClientSymbols+ #x04)
(defconstant +GBN_ServerSymbols+ #x08)
(defconstant +GBN_IndicatorMaps+ #x10)
(defconstant +GBN_KeyNames+ #x20)
(defconstant +GBN_Geometry+ #x40)
(defconstant +GBN_OtherNames+ #x80)
(defconstant +XI_ButtonActions+ #x02)
(defconstant +XI_IndicatorNames+ #x04)
(defconstant +XI_IndicatorMaps+ #x08)
(defconstant +XI_IndicatorState+ #x10)
(defconstant +XI_Keyboards+ #x01)
(defconstant +XI_ButtonActions+ #x02)
(defconstant +XI_IndicatorNames+ #x04)
(defconstant +XI_IndicatorMaps+ #x08)
(defconstant +XI_IndicatorState+ #x10)
(defconstant +XI_Keyboards+ #x01)
(defconstant +XI_ButtonActions+ #x02)
(defconstant +XI_IndicatorNames+ #x04)
(defconstant +XI_IndicatorMaps+ #x08)
(defconstant +XI_IndicatorState+ #x10)
(defconstant +XI_UnsupportedFeature+ #x8000)
(defconstant +DetectableAutorepeat+ #x01)
(defconstant +GrabsUseXKBState+ #x02)
(defconstant +AutoResetControls+ #x04)
(defconstant +LookupStateWhenGrabbed+ #x08)
(defconstant +SendEventUsesXKBState+ #x10)
(defconstant +SetMapResizeTypes+ #x01)
(defconstant +SetMapRecomputeActions+ #x02)
(defconstant +OutlineDoodad+ 1)
(defconstant +SolidDoodad+ 2)
(defconstant +TextDoodad+ 3)
(defconstant +IndicatorDoodad+ 4)
(defconstant +LogoDoodad+ 5)

;;; The version we implement
(defconstant +major-version+ 1)
(defconstant +minor-version+ 0)

;;; KB_DEVICESPEC card8
;;; 0..255 input extension device id
(defconstant +use-core-kbd+ #x100)
(defconstant +use-core-ptr+ #x200)

;;; KB_BELLCLASSRESULT card8
;;KbdFeedbackClass , BellFeedbackClass , DfltXIClass ,
;; AllXIClasses
;; 0 KbdFeedbackClass
;; 5 BellFeedbackClass
(defconstant +kbd-feedback-class+ 0)
(defconstant +bell-feedback-class+ 5)

Loading