mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
rename key2callback to keycallback
This commit is contained in:
@ -987,7 +987,10 @@ pub fn preeditCallback(self: *Surface, preedit: ?u21) !void {
|
|||||||
try self.queueRender();
|
try self.queueRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn key2Callback(
|
/// Called for any key events. This handles keybindings, encoding and
|
||||||
|
/// sending to the termianl, etc. The return value is true if the key
|
||||||
|
/// was handled and false if it was not.
|
||||||
|
pub fn keyCallback(
|
||||||
self: *Surface,
|
self: *Surface,
|
||||||
event: input.KeyEvent,
|
event: input.KeyEvent,
|
||||||
) !bool {
|
) !bool {
|
||||||
|
@ -509,7 +509,7 @@ pub const Surface = struct {
|
|||||||
} else .invalid;
|
} else .invalid;
|
||||||
|
|
||||||
// Invoke the core Ghostty logic to handle this input.
|
// Invoke the core Ghostty logic to handle this input.
|
||||||
const consumed = self.core_surface.key2Callback(.{
|
const consumed = self.core_surface.keyCallback(.{
|
||||||
.action = action,
|
.action = action,
|
||||||
.key = key,
|
.key = key,
|
||||||
.physical_key = physical_key,
|
.physical_key = physical_key,
|
||||||
@ -541,7 +541,7 @@ pub const Surface = struct {
|
|||||||
// For a char callback we just construct a key event with invalid
|
// For a char callback we just construct a key event with invalid
|
||||||
// keys but with text. This should result in the text being sent
|
// keys but with text. This should result in the text being sent
|
||||||
// as-is.
|
// as-is.
|
||||||
_ = self.core_surface.key2Callback(.{
|
_ = self.core_surface.keyCallback(.{
|
||||||
.action = .press,
|
.action = .press,
|
||||||
.key = .invalid,
|
.key = .invalid,
|
||||||
.physical_key = .invalid,
|
.physical_key = .invalid,
|
||||||
|
@ -606,7 +606,7 @@ pub const Surface = struct {
|
|||||||
};
|
};
|
||||||
key_event.utf8 = buf[0..len];
|
key_event.utf8 = buf[0..len];
|
||||||
|
|
||||||
_ = core_win.key2Callback(key_event) catch |err| {
|
_ = core_win.keyCallback(key_event) catch |err| {
|
||||||
log.err("error in key callback err={}", .{err});
|
log.err("error in key callback err={}", .{err});
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
@ -773,7 +773,7 @@ pub const Surface = struct {
|
|||||||
.utf8 = "",
|
.utf8 = "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const consumed = core_win.key2Callback(key_event) catch |err| {
|
const consumed = core_win.keyCallback(key_event) catch |err| {
|
||||||
log.err("error in key callback err={}", .{err});
|
log.err("error in key callback err={}", .{err});
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -1309,7 +1309,7 @@ pub const Surface = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Invoke the core Ghostty logic to handle this input.
|
// Invoke the core Ghostty logic to handle this input.
|
||||||
const consumed = self.core_surface.key2Callback(.{
|
const consumed = self.core_surface.keyCallback(.{
|
||||||
.action = action,
|
.action = action,
|
||||||
.key = key,
|
.key = key,
|
||||||
.physical_key = physical_key,
|
.physical_key = physical_key,
|
||||||
@ -1402,7 +1402,7 @@ pub const Surface = struct {
|
|||||||
// We're not in a keypress, so this was sent from an on-screen emoji
|
// We're not in a keypress, so this was sent from an on-screen emoji
|
||||||
// keyboard or someting like that. Send the characters directly to
|
// keyboard or someting like that. Send the characters directly to
|
||||||
// the surface.
|
// the surface.
|
||||||
_ = self.core_surface.key2Callback(.{
|
_ = self.core_surface.keyCallback(.{
|
||||||
.action = .press,
|
.action = .press,
|
||||||
.key = .invalid,
|
.key = .invalid,
|
||||||
.physical_key = .invalid,
|
.physical_key = .invalid,
|
||||||
|
Reference in New Issue
Block a user