Skip to content

Go: Client

Functions

RegisterKey

Go
func RegisterKey(name string, keyCodes []int32, allowRemap bool, fn func(pressed bool, impact int32)) (*KeyBinding, error)

RegisterKey binds keys on the client: fn runs with pressed true on press and false on release, and the current focus impact. Client hosts only; a server answers not provided.

  • Parameters:
    • name : string
    • keyCodes : []int32
    • allowRemap : bool
    • fn : func(pressed bool, impact int32)
  • Return type: (*KeyBinding, error)
  • Slots: client_register_key

KeyBinding

Go
1
2
3
type KeyBinding struct {
    // unexported fields
}

KeyBinding is a registered client key binding.

KeyBinding.Unregister

Go
func (k *KeyBinding) Unregister() error

Unregister stops the binding's callbacks.

KeyHandle

Go
type KeyHandle struct{ p unsafe.Pointer }
type KeyHandle struct{ p unsafe.Pointer }

KeyHandle is a registered client key binding.

KeyHandle.IsZero

Go
func (h KeyHandle) IsZero() bool

IsZero reports whether the handle names nothing.

  • Return type: bool