#![allow(missing_docs, unused, non_camel_case_types)]
use crate::{ConstInit, NonZeroU32, impl_trait, is};
#[doc = crate::_tags!(interaction)]
#[doc = crate::_doc_location!("ui/event")]
#[repr(u8)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum KeyDead {
Grave = 0, Acute,
Circumflex,
Tilde,
Macron,
Breve,
DotAbove,
Diaeresis,
RingAbove,
DoubleAcute,
Caron,
Cedilla,
Ogonek,
Iota,
VoicedSound,
SemiVoicedSound,
DotBelow,
Hook,
Horn,
Stroke,
CommaAbove,
ReversedCommaAbove,
DoubleGrave,
RingBelow,
MacronBelow,
CircumflexBelow,
TildeBelow,
BreveBelow,
DiaeresisBelow,
InvertedBreve,
CommaBelow,
Currency = 31,
DeadA = 31 + 16, DeadA_Cap,
DeadE,
DeadE_Cap,
DeadI,
DeadI_Cap,
DeadO,
DeadO_Cap,
DeadU,
DeadU_Cap,
DeadSmallSchwa,
DeadCapitalSchwa,
DeadGreek = 31 + 16 + 13,
LowLine = 31 + 16 + 13 + 4, VerticalLineAbove,
VerticalLineBelow,
LongSolidusOverlay,
Unknown = u8::MAX,
}
impl ConstInit for KeyDead {
const INIT: Self = KeyDead::Unknown;
}
#[allow(non_upper_case_globals)]
impl KeyDead {
pub const Perispomeni: Self = Self::Tilde;
pub const Psili: Self = Self::CommaAbove;
pub const Dasia: Self = Self::ReversedCommaAbove;
}
impl KeyDead {
const BASE: u32 = 0xFE50;
pub const fn from_keysym(sym: u32) -> KeyDead {
if sym.wrapping_sub(Self::BASE) < DEAD_TO_SYM.len() as u32 {
DEAD_TO_SYM[(sym - Self::BASE) as usize] } else {
KeyDead::Unknown
}
}
#[inline(always)]
pub const fn to_keysym(kind: KeyDead) -> u32 {
match kind {
KeyDead::Unknown => 0,
_ => 0xFE50 + (kind as u8 as u32),
}
}
}
const DEAD_TO_SYM: [KeyDead; 68] = [
KeyDead::Grave, KeyDead::Acute,
KeyDead::Circumflex,
KeyDead::Tilde,
KeyDead::Macron,
KeyDead::Breve,
KeyDead::DotAbove,
KeyDead::Diaeresis,
KeyDead::RingAbove,
KeyDead::DoubleAcute,
KeyDead::Caron,
KeyDead::Cedilla,
KeyDead::Ogonek,
KeyDead::Iota,
KeyDead::VoicedSound,
KeyDead::SemiVoicedSound,
KeyDead::DotBelow,
KeyDead::Hook,
KeyDead::Horn,
KeyDead::Stroke,
KeyDead::CommaAbove,
KeyDead::ReversedCommaAbove,
KeyDead::DoubleGrave,
KeyDead::RingBelow,
KeyDead::MacronBelow,
KeyDead::CircumflexBelow,
KeyDead::TildeBelow,
KeyDead::BreveBelow,
KeyDead::DiaeresisBelow,
KeyDead::InvertedBreve,
KeyDead::CommaBelow,
KeyDead::Currency,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::DeadA, KeyDead::DeadA_Cap,
KeyDead::DeadE,
KeyDead::DeadE_Cap,
KeyDead::DeadI,
KeyDead::DeadI_Cap,
KeyDead::DeadO,
KeyDead::DeadO_Cap,
KeyDead::DeadU,
KeyDead::DeadU_Cap,
KeyDead::DeadSmallSchwa,
KeyDead::DeadCapitalSchwa,
KeyDead::DeadGreek,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::Unknown,
KeyDead::LowLine, KeyDead::VerticalLineAbove,
KeyDead::VerticalLineBelow,
KeyDead::LongSolidusOverlay, ];