Closed Freed-Wu closed 1 year ago
Press <C-S-+> will increase font size and
will reset font size and will decrease font size.
You can bind the keys like that if you want, but we don't use such bindings by default. Consult our bindings if you want to know how to change the font size.
I refer https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty-bindings.5.scd and try:
key_bindings:
- key: Equals
mods: Shift|Control
action: IncreaseFontSize
- key: Minus
mods: Shift|Control
action: DecreaseFontSize
- key: Key0
mods: Shift|Control
action: ResetFontSize
However, it doesn't work. Seem to be <C-S-X>
(X is +
, -
, 0
) cannot be mapped?
because Shift
changes key. You can look at --print-events
to figure out how to bind those keys.
You can look at --print-events to figure out how to bind those keys.
I found this:
[10.285567884s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94663214702720)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 13, state: Pressed, virtual_keycode: Some(Plus), modifiers: SHIFT | CTRL }, is_synthetic: false } }
I notice virtual_keycode: Some(Plus)
, So I got this can work:
key_bindings:
- key: Plus
mods: Shift|Control
action: IncreaseFontSize
- key: Underline
mods: Shift|Control
action: DecreaseFontSize
However, about <C-S-0>
, It is:
[8.930779429s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94000307693376)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 41, state: Released, virtual_keycode: Some(Grave), modifiers: (empty) }, is_synthetic: false } }
[10.162123109s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94000307693376)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 42, state: Pressed, virtual_keycode: Some(LShift), modifiers: (empty) }, is_synthetic: false } }
[10.284540319s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94000307693376)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 58, state: Pressed, virtual_keycode: None, modifiers: SHIFT }, is_synthetic: false } }
[10.591262219s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94000307693376)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 11, state: Pressed, virtual_keycode: None, modifiers: SHIFT | CTRL }, is_synthetic: false } }
[10.831094352s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94000307693376)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 11, state: Released, virtual_keycode: None, modifiers: SHIFT | CTRL }, is_synthetic: false } }
[10.841783762s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94000307693376)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 58, state: Released, virtual_keycode: None, modifiers: SHIFT | CTRL }, is_synthetic: false } }
[10.922230720s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94000307693376)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 42, state: Released, virtual_keycode: Some(LShift), modifiers: SHIFT }, is_synthetic: false } }
[11.419774021s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(94000307693376)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), input: KeyboardInput { scancode: 56, state: Pressed, virtual_keycode: Some(LAlt), modifiers: (empty) }, is_synthetic: false } }
I cannot know virtual_keycode: None
is what key?
In such cases you bind by scancode.
So key: 58
or key: 11
?
Yes, it is key: 11
. Thanks!
System
OS: Linux 6.5.2-arch1-1 Version: alacritty 0.12.2 (9d9982df) Linux/BSD: X11
Expected Behaviour
Press
<C-S-+>
will increase font size and<C-S-0>
will reset font size and<C-S-->
will decrease font size.Actual Behaviour
Only get
+
,0
,-
Logs
Crashes: STDERR, STDOUT Font/Terminal size:
alacritty -vv
Keyboard and bindings:alacritty --print-events