summaryrefslogtreecommitdiff
path: root/XOrg
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-07-25 15:55:00 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-27 12:22:41 +1000
commit29ef84016dfa6aa2387a7a4cc8f1b668bdbf86b2 (patch)
tree39c6a60b25bbbdd988c9802d606375644e1e68ed /XOrg
parent36c5ab2a8b20bbd43a94acb23c81c3835077e3ca (diff)
XOrg: parse options too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'XOrg')
-rwxr-xr-xXOrg/InputDevice.pm21
-rwxr-xr-xXOrg/xorglog.pm2
2 files changed, 23 insertions, 0 deletions
diff --git a/XOrg/InputDevice.pm b/XOrg/InputDevice.pm
index f75df3d..3b7be62 100755
--- a/XOrg/InputDevice.pm
+++ b/XOrg/InputDevice.pm
@@ -39,6 +39,7 @@ sub new {
bless ($self, $class);
$self->{inputclasses} = [()] if not $self->{inputclasses};
+ $self->{options} = {} if not $self->{options};
return $self;
}
@@ -108,6 +109,26 @@ sub add_inputclass {
push @{$self->{inputclasses}}, $cls;
}
+# The hash of options the device reported to the log.
+# Returns:
+# - A hash of the options
+sub options {
+ my $self = shift;
+ return %{$self->{options}};
+}
+
+# Add one option to the device
+# Arguments:
+# - option key
+# - option value
+sub add_option {
+ my $self = shift;
+ my $opt = shift;
+ my $val = shift;
+
+ $self->{options}->{$opt} = $val;
+}
+
1;
# vim: set noexpandtab shiftwidth=8 tabstop=8:
diff --git a/XOrg/xorglog.pm b/XOrg/xorglog.pm
index 77f9438..da62080 100755
--- a/XOrg/xorglog.pm
+++ b/XOrg/xorglog.pm
@@ -204,6 +204,8 @@ sub _parse_input_drivers {
$dev->add_inputclass($1)
} elsif ($_ =~ /$time_regex \(II\) Using input driver '(.*)' for '$dev->{name}'/) {
$dev->module($self->modules->{$1});
+ } elsif ($_ =~ /$time_regex \(\*\*\) Option "(.*)" "(.*)"/) {
+ $dev->add_option($1, $2);
}
}
}