author | mickeyl <mickeyl> | 2005-02-04 14:39:34 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-02-04 14:39:34 (UTC) |
commit | 93f9fcf5bbcecaf8c7c4070e42676d24caa12d87 (patch) (side-by-side diff) | |
tree | ccd643cf2cdf2d211b5cba4d09e9cc6b9dbec381 /libopie2/opiecore/oinputsystem.cpp | |
parent | 43213784ac3b6057f8c83f22604d75d0557e8c5a (diff) | |
download | opie-93f9fcf5bbcecaf8c7c4070e42676d24caa12d87.zip opie-93f9fcf5bbcecaf8c7c4070e42676d24caa12d87.tar.gz opie-93f9fcf5bbcecaf8c7c4070e42676d24caa12d87.tar.bz2 |
- add definitions for keys and buttons
- add isHeld( Key )
Diffstat (limited to 'libopie2/opiecore/oinputsystem.cpp') (more/less context) (show 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 + bool OInputDevice::hasFeature( Feature bit ) const @@ -156 +157,16 @@ bool OInputDevice::hasFeature( Feature bit ) const + +bool OInputDevice::isHeld( Key bit ) const +{ + BIT_MASK( keys, KEY_MAX ); + + if( ioctl( _fd, EVIOCGKEY( sizeof(keys) ), keys ) < 0 ) + { + perror( "EVIOCGKEY" ); + return false; + } + else + { + return BIT_TEST( keys, bit ); + } +} |