XWorkstation.st
changeset 5586 1c02d95a3e80
parent 5568 3d18b7fa928a
child 5716 27e02ce4e72a
equal deleted inserted replaced
5585:15f2e95a8c20 5586:1c02d95a3e80
  8690      We return an array of arrays of keycodes"
  8690      We return an array of arrays of keycodes"
  8691 
  8691 
  8692     |modifierKeyMap maxKeyPerMod ret nextKey|
  8692     |modifierKeyMap maxKeyPerMod ret nextKey|
  8693 
  8693 
  8694     modifierKeyMap := self rawModifierMapping.
  8694     modifierKeyMap := self rawModifierMapping.
       
  8695     modifierKeyMap isEmptyOrNil ifTrue:[^ nil].
  8695     maxKeyPerMod := modifierKeyMap size // 8.
  8696     maxKeyPerMod := modifierKeyMap size // 8.
  8696     modifierKeyMap isNil ifTrue:[^ nil].
       
  8697 
  8697 
  8698     ret := Array new:8.
  8698     ret := Array new:8.
  8699     nextKey := 1.
  8699     nextKey := 1.
  8700     1 to:8 do:[ :i |
  8700     1 to:8 do:[ :i |
  8701         (modifierKeyMap at:nextKey) ~= 0 ifTrue:[
  8701         (modifierKeyMap at:nextKey) ~= 0 ifTrue:[
  8745 !
  8745 !
  8746 
  8746 
  8747 rawModifierMapping
  8747 rawModifierMapping
  8748     "Get the raw Modifier Mapping."
  8748     "Get the raw Modifier Mapping."
  8749 
  8749 
  8750     |modifierKeyMap maxKeyPerMod |
  8750     |modifierKeyMap|
  8751 
  8751 
  8752 %{
  8752 %{
  8753     XModifierKeymap *modmap;
  8753     XModifierKeymap *modmap;
  8754 
  8754 
  8755     if (ISCONNECTED) {
  8755     if (ISCONNECTED) {
  8756         Display *dpy = myDpy;
  8756         Display *dpy = myDpy;
  8757 
  8757 
  8758         if ((modmap = XGetModifierMapping(dpy)) != 0) {
  8758         if ((modmap = XGetModifierMapping(dpy)) != 0) {
  8759            maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
       
  8760            modifierKeyMap = __BYTEARRAY_UNINITIALIZED_NEW_INT(modmap->max_keypermod * 8);
  8759            modifierKeyMap = __BYTEARRAY_UNINITIALIZED_NEW_INT(modmap->max_keypermod * 8);
  8761            if (modifierKeyMap != nil) {
  8760            if (modifierKeyMap != nil) {
  8762                 memcpy((char *)__ByteArrayInstPtr(modifierKeyMap)->ba_element,
  8761                 memcpy((char *)__ByteArrayInstPtr(modifierKeyMap)->ba_element,
  8763                        (char *)modmap->modifiermap, modmap->max_keypermod * 8);
  8762                        (char *)modmap->modifiermap, modmap->max_keypermod * 8);
  8764            }
  8763            }
 12025 ! !
 12024 ! !
 12026 
 12025 
 12027 !XWorkstation class methodsFor:'documentation'!
 12026 !XWorkstation class methodsFor:'documentation'!
 12028 
 12027 
 12029 version
 12028 version
 12030     ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.514 2010-07-05 19:08:51 stefan Exp $'
 12029     ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.515 2010-08-03 09:20:05 stefan Exp $'
 12031 !
 12030 !
 12032 
 12031 
 12033 version_CVS
 12032 version_CVS
 12034     ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.514 2010-07-05 19:08:51 stefan Exp $'
 12033     ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.515 2010-08-03 09:20:05 stefan Exp $'
 12035 ! !
 12034 ! !
 12036 
 12035 
 12037 XWorkstation initialize!
 12036 XWorkstation initialize!