From 7e7dcedaf31ee35499875491c9f569c575d28435 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 14 Feb 2022 14:55:59 +0100 Subject: Port from GTK3 to GTK4 --- main/src/ui/chat_input/smiley_converter.vala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main/src/ui/chat_input/smiley_converter.vala') diff --git a/main/src/ui/chat_input/smiley_converter.vala b/main/src/ui/chat_input/smiley_converter.vala index 8f4dee9a..fe280d99 100644 --- a/main/src/ui/chat_input/smiley_converter.vala +++ b/main/src/ui/chat_input/smiley_converter.vala @@ -33,11 +33,13 @@ class SmileyConverter { public SmileyConverter(TextView text_input) { this.text_input = text_input; - text_input.key_press_event.connect(on_text_input_key_press); + var text_input_key_events = new EventControllerKey(); + text_input_key_events.key_pressed.connect(on_text_input_key_press); + text_input.add_controller(text_input_key_events); } - public bool on_text_input_key_press(EventKey event) { - if (event.keyval == Key.space || event.keyval == Key.Return) { + public bool on_text_input_key_press(uint keyval, uint keycode, Gdk.ModifierType state) { + if (keyval == Key.space || keyval == Key.Return) { check_convert(); } return false; -- cgit v1.2.3-54-g00ecf