summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/oinputsystem.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/oinputsystem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/oinputsystem.cpp16
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
@@ -145,4 +145,5 @@ QString OInputDevice::uniq() const
145} 145}
146 146
147
147bool OInputDevice::hasFeature( Feature bit ) const 148bool OInputDevice::hasFeature( Feature bit ) const
148{ 149{
@@ -155,2 +156,17 @@ bool OInputDevice::hasFeature( Feature bit ) const
155} 156}
156 157
158
159bool 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}