packages feed

sdl3-bindgen-sys-0.0.0.1: src/SDL3/Sys/Keycode.hs

{-# LANGUAGE PatternSynonyms #-}

-- | Defines constants which identify keyboard keys and modifiers.
--
--     Please refer to the Best Keyboard Practices document for details on what this information means and how best to use it.
--
--     [https:\/\/wiki.libsdl.org\/SDL3\/BestKeyboardPractices](https://wiki.libsdl.org/SDL3/BestKeyboardPractices) The SDL virtual key representation.
--
--     Values of this type are used to represent keyboard keys using the current layout of the keyboard. These values include Unicode values representing the unmodified character that would be generated by pressing the key, or an @SDLK_*@ constant for those keys that do not generate characters.
--
--     A special exception is the number keys at the top of the keyboard which map by default to SDLK_0...SDLK_9 on AZERTY layouts.
--
--     Keys with the @'sDLK_EXTENDED_MASK'@ bit set do not map to a scancode or Unicode code point.
--
--     Many common keycodes are listed below, but this list is not exhaustive.
--
--     @since 3.2.0
--
--     [See also]: SDL_HINT_KEYCODE_OPTIONS
--
--     == FFI conventions
--
--     Unsuffixed aliases are __unsafe__ foreign imports; aliases suffixed @Safe@ are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under @SDL3.Sys.Bindgen.Keycode.Unsafe@); functions curated unsafe-only export only the unsuffixed one. Each alias\'s documentation records its flavor and rationale.
--
--     Full conventions: "SDL3.Sys".
module SDL3.Sys.Keycode (
  module SDL3.Sys.Bindgen.Keycode,

  -- * Typed constants
  pattern SDL3.Sys.Keycode.SDL_KMOD_NONE,
  pattern SDL3.Sys.Keycode.SDL_KMOD_LSHIFT,
  pattern SDL3.Sys.Keycode.SDL_KMOD_RSHIFT,
  pattern SDL3.Sys.Keycode.SDL_KMOD_LEVEL5,
  pattern SDL3.Sys.Keycode.SDL_KMOD_LCTRL,
  pattern SDL3.Sys.Keycode.SDL_KMOD_RCTRL,
  pattern SDL3.Sys.Keycode.SDL_KMOD_LALT,
  pattern SDL3.Sys.Keycode.SDL_KMOD_RALT,
  pattern SDL3.Sys.Keycode.SDL_KMOD_LGUI,
  pattern SDL3.Sys.Keycode.SDL_KMOD_RGUI,
  pattern SDL3.Sys.Keycode.SDL_KMOD_NUM,
  pattern SDL3.Sys.Keycode.SDL_KMOD_CAPS,
  pattern SDL3.Sys.Keycode.SDL_KMOD_MODE,
  pattern SDL3.Sys.Keycode.SDL_KMOD_SCROLL,
  pattern SDL3.Sys.Keycode.SDL_KMOD_CTRL,
  pattern SDL3.Sys.Keycode.SDL_KMOD_SHIFT,
  pattern SDL3.Sys.Keycode.SDL_KMOD_ALT,
  pattern SDL3.Sys.Keycode.SDL_KMOD_GUI,
)
where

import SDL3.Sys.Bindgen.Keycode

-- | Typed constant for macro @SDL_KMOD_NONE@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_NONE :: SDL_Keymod
pattern SDL_KMOD_NONE = SDL_Keymod 0x0000

-- | Typed constant for macro @SDL_KMOD_LSHIFT@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_LSHIFT :: SDL_Keymod
pattern SDL_KMOD_LSHIFT = SDL_Keymod 0x0001

-- | Typed constant for macro @SDL_KMOD_RSHIFT@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_RSHIFT :: SDL_Keymod
pattern SDL_KMOD_RSHIFT = SDL_Keymod 0x0002

-- | Typed constant for macro @SDL_KMOD_LEVEL5@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_LEVEL5 :: SDL_Keymod
pattern SDL_KMOD_LEVEL5 = SDL_Keymod 0x0004

-- | Typed constant for macro @SDL_KMOD_LCTRL@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_LCTRL :: SDL_Keymod
pattern SDL_KMOD_LCTRL = SDL_Keymod 0x0040

-- | Typed constant for macro @SDL_KMOD_RCTRL@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_RCTRL :: SDL_Keymod
pattern SDL_KMOD_RCTRL = SDL_Keymod 0x0080

-- | Typed constant for macro @SDL_KMOD_LALT@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_LALT :: SDL_Keymod
pattern SDL_KMOD_LALT = SDL_Keymod 0x0100

-- | Typed constant for macro @SDL_KMOD_RALT@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_RALT :: SDL_Keymod
pattern SDL_KMOD_RALT = SDL_Keymod 0x0200

-- | Typed constant for macro @SDL_KMOD_LGUI@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_LGUI :: SDL_Keymod
pattern SDL_KMOD_LGUI = SDL_Keymod 0x0400

-- | Typed constant for macro @SDL_KMOD_RGUI@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_RGUI :: SDL_Keymod
pattern SDL_KMOD_RGUI = SDL_Keymod 0x0800

-- | Typed constant for macro @SDL_KMOD_NUM@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_NUM :: SDL_Keymod
pattern SDL_KMOD_NUM = SDL_Keymod 0x1000

-- | Typed constant for macro @SDL_KMOD_CAPS@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_CAPS :: SDL_Keymod
pattern SDL_KMOD_CAPS = SDL_Keymod 0x2000

-- | Typed constant for macro @SDL_KMOD_MODE@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_MODE :: SDL_Keymod
pattern SDL_KMOD_MODE = SDL_Keymod 0x4000

-- | Typed constant for macro @SDL_KMOD_SCROLL@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_SCROLL :: SDL_Keymod
pattern SDL_KMOD_SCROLL = SDL_Keymod 0x8000

-- | Typed constant for macro @SDL_KMOD_CTRL@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_CTRL :: SDL_Keymod
pattern SDL_KMOD_CTRL = SDL_Keymod 0x00c0

-- | Typed constant for macro @SDL_KMOD_SHIFT@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_SHIFT :: SDL_Keymod
pattern SDL_KMOD_SHIFT = SDL_Keymod 0x0003

-- | Typed constant for macro @SDL_KMOD_ALT@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_ALT :: SDL_Keymod
pattern SDL_KMOD_ALT = SDL_Keymod 0x0300

-- | Typed constant for macro @SDL_KMOD_GUI@. Combine with @.|.@ from "Data.Bits".
pattern SDL_KMOD_GUI :: SDL_Keymod
pattern SDL_KMOD_GUI = SDL_Keymod 0x0c00