From fba9e553cc663881f22a2a5da8fbc21433837e35 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 17 Oct 2024 00:53:41 +0200 Subject: feat(glfw): add variants associated array to Key enum --- glfw/src/window.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'glfw/src/window.rs') diff --git a/glfw/src/window.rs b/glfw/src/window.rs index eaa0c56..5c30c16 100644 --- a/glfw/src/window.rs +++ b/glfw/src/window.rs @@ -5,7 +5,7 @@ use std::io::{stdout, Write}; use std::ptr::null_mut; use bitflags::bitflags; -use util_macros::FromRepr; +use util_macros::{FromRepr, VariantArr}; use crate::init::{initialize, Glfw}; use crate::{get_glfw_error, Error}; @@ -525,7 +525,8 @@ pub enum CursorMode Normal = crate::ffi::GLFW_CURSOR_NORMAL, } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, FromRepr)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, FromRepr, VariantArr)] +#[variant_arr(name = KEYS)] #[repr(i32)] pub enum Key { -- cgit v1.2.3-18-g5258