Diffstat (limited to 'libopie2/opiecore/oinputsystem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/oinputsystem.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libopie2/opiecore/oinputsystem.cpp b/libopie2/opiecore/oinputsystem.cpp index 8253c18..29de35c 100644 --- a/libopie2/opiecore/oinputsystem.cpp +++ b/libopie2/opiecore/oinputsystem.cpp | |||
@@ -146,2 +146,3 @@ QString OInputDevice::uniq() const | |||
146 | 146 | ||
147 | |||
147 | bool OInputDevice::hasFeature( Feature bit ) const | 148 | bool OInputDevice::hasFeature( Feature bit ) const |
@@ -156 +157,16 @@ bool OInputDevice::hasFeature( Feature bit ) const | |||
156 | 157 | ||
158 | |||
159 | bool OInputDevice::isHeld( Key bit ) const | ||
160 | { | ||
161 | BIT_MASK( keys, KEY_MAX ); | ||
162 | |||
163 | if( ioctl( _fd, EVIOCGKEY( sizeof(keys) ), keys ) < 0 ) | ||
164 | { | ||
165 | perror( "EVIOCGKEY" ); | ||
166 | return false; | ||
167 | } | ||
168 | else | ||
169 | { | ||
170 | return BIT_TEST( keys, bit ); | ||
171 | } | ||
172 | } | ||