Paste: xinput2 ffi; some refactoring left :)

Author: ceninan
Mode: factor
Date: Thu, 20 May 2010 22:43:18
Plain Text |
! (uchar*)mask[event>>3] |= 1 << (event & 7)
:: XISetMask ( mask event -- )
    event -3 shift :> index
    1 event 7 bitand shift index mask nth bitor
    index mask set-nth ; inline

! (uchar*)mask[event>>3] &= ~(1 << (event & 7))
:: XIClearMask ( mask event -- )
    event -3 shift :> index
    1 event 7 bitand shift bitnot index mask nth bitand
    index mask set-nth ; inline

! (uchar*)mask[event>>3] & (1 << (event & 7 ))
:: XIMaskIsSet ( mask event -- n )
    event -3 shift :> index
    1 event 7 bitand shift index mask nth bitand ;

! event+7 >> 3
: XIMaskLen ( event -- n ) 7 + -3 shift

New Annotation

Summary:
Author:
Mode:
Body: