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();
|
||||
}
|
||||
|
||||
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,
|
||||
event: input.KeyEvent,
|
||||
) !bool {
|
||||
|
@ -509,7 +509,7 @@ pub const Surface = struct {
|
||||
} else .invalid;
|
||||
|
||||
// Invoke the core Ghostty logic to handle this input.
|
||||
const consumed = self.core_surface.key2Callback(.{
|
||||
const consumed = self.core_surface.keyCallback(.{
|
||||
.action = action,
|
||||
.key = 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
|
||||
// keys but with text. This should result in the text being sent
|
||||
// as-is.
|
||||
_ = self.core_surface.key2Callback(.{
|
||||
_ = self.core_surface.keyCallback(.{
|
||||
.action = .press,
|
||||
.key = .invalid,
|
||||
.physical_key = .invalid,
|
||||
|
@ -606,7 +606,7 @@ pub const Surface = struct {
|
||||
};
|
||||
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});
|
||||
return;
|
||||
};
|
||||
@ -773,7 +773,7 @@ pub const Surface = struct {
|
||||
.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});
|
||||
return;
|
||||
};
|
||||
|
@ -1309,7 +1309,7 @@ pub const Surface = struct {
|
||||
}
|
||||
|
||||
// Invoke the core Ghostty logic to handle this input.
|
||||
const consumed = self.core_surface.key2Callback(.{
|
||||
const consumed = self.core_surface.keyCallback(.{
|
||||
.action = action,
|
||||
.key = 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
|
||||
// keyboard or someting like that. Send the characters directly to
|
||||
// the surface.
|
||||
_ = self.core_surface.key2Callback(.{
|
||||
_ = self.core_surface.keyCallback(.{
|
||||
.action = .press,
|
||||
.key = .invalid,
|
||||
.physical_key = .invalid,
|
||||
|
Reference in New Issue
Block a user