MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / push_char

Method push_char

native/shared/src/input.rs:177–184  ·  view source on GitHub ↗

Push a Unicode codepoint into the character input queue. Called by platform event loops when a key-down event produces a printable char.

(&mut self, c: u32)

Source from the content-addressed store, hash-verified

175 /// Push a Unicode codepoint into the character input queue. Called by
176 /// platform event loops when a key-down event produces a printable char.
177 pub fn push_char(&mut self, c: u32) {
178 let next = (self.char_queue_head + 1) % self.char_queue.len();
179 if next != self.char_queue_tail {
180 self.char_queue[self.char_queue_head] = c;
181 self.char_queue_head = next;
182 }
183 // If the queue is full, silently drop the character.
184 }
185
186 /// Pop the next queued character. Returns 0 when the queue is empty.
187 /// Called once per frame by the editor's text-input widget.

Callers 2

bloom_begin_drawingFunction · 0.80
poll_eventsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected