github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/protocol/gui-event_keyboard.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package protocol
     4  
     5  // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
     6  type KeyboardEvent interface {
     7  	Event
     8  
     9  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#events
    10  	Type() KeyboardEventType
    11  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key
    12  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
    13  	Key() KeyboardEventKey
    14  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
    15  	Code() KeyboardEventCode
    16  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
    17  	Repeat() bool
    18  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/altKey
    19  	AltKey() bool
    20  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/ctrlKey
    21  	CtrlKey() bool
    22  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/shiftKey
    23  	ShiftKey() bool
    24  	// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/metaKey
    25  	MetaKey() bool
    26  }
    27  
    28  type KeyboardEventType uint8
    29  
    30  const (
    31  	KeyboardEventType_Unset KeyboardEventType = iota
    32  	// https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event
    33  	KeyboardEventType_Key_Down
    34  	// https://developer.mozilla.org/en-US/docs/Web/API/Document/keyup_event
    35  	KeyboardEventType_Key_Up
    36  	// https://developer.mozilla.org/en-US/docs/Web/API/Document/keypress_event
    37  	// KeyboardEventType_Key_Press **Deprecated**
    38  )
    39  
    40  type KeyboardEventKey uint16
    41  
    42  const ()
    43  
    44  type KeyboardEventCode uint16
    45  
    46  const ()