mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-07 19:21:14 -04:00
parent
ca37eb97d7
commit
d99c9ede01
@ -114,6 +114,7 @@ pub const GLFWCallbacks = struct {
|
|||||||
std.log.err("GLFW Error({}): {s}", .{errorCode, description});
|
std.log.err("GLFW Error({}): {s}", .{errorCode, description});
|
||||||
}
|
}
|
||||||
fn keyCallback(_: ?*c.GLFWwindow, glfw_key: c_int, scancode: c_int, action: c_int, _mods: c_int) callconv(.C) void {
|
fn keyCallback(_: ?*c.GLFWwindow, glfw_key: c_int, scancode: c_int, action: c_int, _mods: c_int) callconv(.C) void {
|
||||||
|
if(main.gui.selectedTextInput != null and c.glfwGetKeyName(glfw_key, scancode) != null) return; // Don't send events for keys that are used in writing letters.
|
||||||
const mods: Key.Modifiers = @bitCast(@as(u6, @intCast(_mods)));
|
const mods: Key.Modifiers = @bitCast(@as(u6, @intCast(_mods)));
|
||||||
if(action == c.GLFW_PRESS) {
|
if(action == c.GLFW_PRESS) {
|
||||||
for(&main.KeyBoard.keys) |*key| {
|
for(&main.KeyBoard.keys) |*key| {
|
||||||
|
@ -27,7 +27,7 @@ var windowList: List(*GuiWindow) = undefined;
|
|||||||
var hudWindows: List(*GuiWindow) = undefined;
|
var hudWindows: List(*GuiWindow) = undefined;
|
||||||
pub var openWindows: List(*GuiWindow) = undefined;
|
pub var openWindows: List(*GuiWindow) = undefined;
|
||||||
var selectedWindow: ?*GuiWindow = null;
|
var selectedWindow: ?*GuiWindow = null;
|
||||||
var selectedTextInput: ?*TextInput = null;
|
pub var selectedTextInput: ?*TextInput = null;
|
||||||
var hoveredAWindow: bool = false;
|
var hoveredAWindow: bool = false;
|
||||||
|
|
||||||
pub var scale: f32 = undefined;
|
pub var scale: f32 = undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user