@ -2,15 +2,15 @@
""" Change mouse script
""" Change mouse script
Whenever a mouse is changed to the system , this script will be executed . These
Whenever a mouse is changed to the system , this script will be executed . These
are the rules :
are the rules :
+ All regular mouses should connect to the " Virtual core pointer " of the
+ All regular mouses should connect to the " Virtual core pointer " of the
system
system
+ Touchpanel should be connected to the master " touch-pointer "
+ Touchpanel should be connected to the master " touch-pointer "
NOTE : master " touch-pointer " should be available on the event of adding the
NOTE : master " touch-pointer " should be available on the event of adding the
mouse . This could be reached by adding this master to the system on boot .
mouse . This could be reached by adding this master to the system on boot .
Steps :
Steps :
+ List all pointer as we don ' t know what pointer is added to the system
+ List all pointer as we don ' t know what pointer is added to the system
+ group them by their usage by name rules ( As if the pointer is eGalax
+ group them by their usage by name rules ( As if the pointer is eGalax
@ -32,7 +32,7 @@ if __name__ == "__main__":
pointers = xup . get_pointers ( )
pointers = xup . get_pointers ( )
# TODO filter functionality inside utilities
# TODO filter functionality inside utilities
core_master = list ( filter ( lambda x : " Virtual core " in x . name , pointers ) ) [ 0 ]
core_master = list ( filter ( lambda x : " Virtual core " in x . name , pointers ) ) [ 0 ]
for pointer in filter ( lambda x : not x . slave , pointers ) :
for pointer in filter ( lambda x : x . slave , pointers ) :
if not " eGalax " in pointer . name :
if not " eGalax " in pointer . name :
com . reattach ( pointer . id , core_master . id )
com . reattach ( pointer . id , core_master . id )
else :
else :