2
0
Fork 0

input_filter: patch for survivibility

This commit is contained in:
Emery Hemingway 2020-04-29 03:37:24 +05:30
parent 06c8283dee
commit 0c981604d8
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,24 @@
commit ae03115e473fd7a16e172ccaa91d1ddc2cdc7d29
Author: Emery Hemingway <ehmry@posteo.net>
Date: Wed Apr 29 03:34:15 2020 +0530
input_filter: survive unrecognized keys
diff --git a/repos/os/src/server/input_filter/chargen_source.h b/repos/os/src/server/input_filter/chargen_source.h
index 06fc657c25..3525fd6f34 100644
--- a/repos/os/src/server/input_filter/chargen_source.h
+++ b/repos/os/src/server/input_filter/chargen_source.h
@@ -684,9 +684,10 @@ class Input_filter::Chargen_source : public Source, Source::Sink
node.for_each_sub_node("key", [&] (Xml_node key_node) {
Key_name const name = key_node.attribute_value("name", Key_name());
- Input::Keycode const key = key_code_by_name(name);
-
- new (_alloc) Modifier(_modifiers, id, key);
+ try {
+ Input::Keycode const key = key_code_by_name(name);
+ new (_alloc) Modifier(_modifiers, id, key);
+ } catch (Unknown_key) { warning("unrecognized key name ", name); }
});
node.for_each_sub_node("rom", [&] (Xml_node rom_node) {

View File

@ -5,6 +5,8 @@ with ports; {
init.patches = [ ./sandbox.patch ];
input_filter.patches = [ ./input_filter.patch ];
intel_fb_drv = {
BOARD = "pc";
portInputs = [ dde_linux ];