terminal: device attributes
parent
a4a37534d7
commit
fd0f9bb843
|
|
@ -94,6 +94,7 @@ pub const Action = union(Key) {
|
||||||
title_pop: u16,
|
title_pop: u16,
|
||||||
xtversion,
|
xtversion,
|
||||||
device_attributes: ansi.DeviceAttributeReq,
|
device_attributes: ansi.DeviceAttributeReq,
|
||||||
|
device_status: DeviceStatus,
|
||||||
kitty_keyboard_query,
|
kitty_keyboard_query,
|
||||||
kitty_keyboard_push: KittyKeyboardFlags,
|
kitty_keyboard_push: KittyKeyboardFlags,
|
||||||
kitty_keyboard_pop: u16,
|
kitty_keyboard_pop: u16,
|
||||||
|
|
@ -179,6 +180,7 @@ pub const Action = union(Key) {
|
||||||
"title_pop",
|
"title_pop",
|
||||||
"xtversion",
|
"xtversion",
|
||||||
"device_attributes",
|
"device_attributes",
|
||||||
|
"device_status",
|
||||||
"kitty_keyboard_query",
|
"kitty_keyboard_query",
|
||||||
"kitty_keyboard_push",
|
"kitty_keyboard_push",
|
||||||
"kitty_keyboard_pop",
|
"kitty_keyboard_pop",
|
||||||
|
|
@ -245,6 +247,16 @@ pub const Action = union(Key) {
|
||||||
col: u16,
|
col: u16,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const DeviceStatus = struct {
|
||||||
|
request: device_status.Request,
|
||||||
|
|
||||||
|
pub const C = u16;
|
||||||
|
|
||||||
|
pub fn cval(self: DeviceStatus) DeviceStatus.C {
|
||||||
|
return @bitCast(self.request);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
pub const Mode = struct {
|
pub const Mode = struct {
|
||||||
mode: modes.Mode,
|
mode: modes.Mode,
|
||||||
|
|
||||||
|
|
@ -1054,7 +1066,7 @@ pub fn Stream(comptime Handler: type) type {
|
||||||
},
|
},
|
||||||
else => null,
|
else => null,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (req) |r| {
|
if (req) |r| {
|
||||||
try self.handler.vt(.device_attributes, r);
|
try self.handler.vt(.device_attributes, r);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1249,11 +1261,6 @@ pub fn Stream(comptime Handler: type) type {
|
||||||
if (input.intermediates.len == 0 or
|
if (input.intermediates.len == 0 or
|
||||||
input.intermediates[0] == '?')
|
input.intermediates[0] == '?')
|
||||||
{
|
{
|
||||||
if (!@hasDecl(T, "deviceStatusReport")) {
|
|
||||||
log.warn("unimplemented CSI callback: {f}", .{input});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input.params.len != 1) {
|
if (input.params.len != 1) {
|
||||||
log.warn("invalid device status report command: {f}", .{input});
|
log.warn("invalid device status report command: {f}", .{input});
|
||||||
return;
|
return;
|
||||||
|
|
@ -1273,7 +1280,7 @@ pub fn Stream(comptime Handler: type) type {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
try self.handler.deviceStatusReport(req);
|
try self.handler.vt(.device_status, .{ .request = req });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -278,6 +278,7 @@ pub const StreamHandler = struct {
|
||||||
.size_report => self.sendSizeReport(value),
|
.size_report => self.sendSizeReport(value),
|
||||||
.xtversion => try self.reportXtversion(),
|
.xtversion => try self.reportXtversion(),
|
||||||
.device_attributes => try self.deviceAttributes(value),
|
.device_attributes => try self.deviceAttributes(value),
|
||||||
|
.device_status => try self.deviceStatusReport(value.request),
|
||||||
.kitty_keyboard_query => try self.queryKittyKeyboard(),
|
.kitty_keyboard_query => try self.queryKittyKeyboard(),
|
||||||
.kitty_keyboard_push => {
|
.kitty_keyboard_push => {
|
||||||
log.debug("pushing kitty keyboard mode: {}", .{value.flags});
|
log.debug("pushing kitty keyboard mode: {}", .{value.flags});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue