Show
Ignore:
Timestamp:
01/27/11 17:23:48 (4 years ago)
Author:
robert
Message:

From Alexander Sinditskiy, "reason of this changes described in http://forum.openscenegraph.org/viewtopic.php?t=7596

and another problem is:
example osgkeyboard is not work (keys not highlight) if user have 2 keyboard layout native and english and current user layout is native

I try to explain my changes

we need something that is identify key without modifier keys and layout -> this is UnmodifedKey?

I think osg must have its own UnmodifiedKeys? table. Code must be run same on different platforms. This can de guaranteed by UnmodifiedKeys? table.

Mikhail Izmestev helped me. He implemented VirtualKey? changes in GraphicsWindowX11"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowX11.cpp

    r12003 r12125  
    14151415                keyMapSetKey(_keyMap, ev.xkey.keycode); 
    14161416                int keySymbol = 0; 
    1417                 adaptKey(ev.xkey, keySymbol); 
    1418  
    1419                 getEventQueue()->keyPress(keySymbol, eventTime); 
     1417                int unmodifiedKeySymbol = 0; 
     1418                adaptKey(ev.xkey, keySymbol, unmodifiedKeySymbol); 
     1419 
     1420                getEventQueue()->keyPress(keySymbol, eventTime, unmodifiedKeySymbol); 
    14201421                break; 
    14211422            } 
     
    14461447                keyMapClearKey(_keyMap, ev.xkey.keycode); 
    14471448                int keySymbol = 0; 
    1448                 adaptKey(ev.xkey, keySymbol); 
     1449                int unmodifiedKeySymbol = 0; 
     1450                adaptKey(ev.xkey, keySymbol, unmodifiedKeySymbol); 
    14491451                 
    1450                 getEventQueue()->keyRelease(keySymbol, eventTime); 
     1452                getEventQueue()->keyRelease(keySymbol, eventTime, unmodifiedKeySymbol); 
    14511453                break; 
    14521454            } 
     
    15191521} 
    15201522 
    1521 void GraphicsWindowX11::adaptKey(XKeyEvent& keyevent, int& keySymbol) 
     1523void GraphicsWindowX11::adaptKey(XKeyEvent& keyevent, int& keySymbol, int& unmodifiedKeySymbol) 
    15221524{ 
    15231525    unsigned char buffer_return[32]; 
     
    15311533        keySymbol = buffer_return[0]; 
    15321534    } 
     1535 
     1536    unmodifiedKeySymbol = XKeycodeToKeysym(keyevent.display, keyevent.keycode, 0); 
    15331537} 
    15341538 
     
    15541558 
    15551559    int keySymbol = 0; 
     1560    int unmodifiedKeySymbol = 0; 
    15561561    if (state) 
    15571562    { 
    15581563        event.type = KeyPress; 
    1559         adaptKey(event, keySymbol); 
    1560         getEventQueue()->keyPress(keySymbol, time); 
     1564        adaptKey(event, keySymbol, unmodifiedKeySymbol); 
     1565        getEventQueue()->keyPress(keySymbol, time, unmodifiedKeySymbol); 
    15611566        keyMapSetKey(_keyMap, key); 
    15621567    } 
     
    15641569    { 
    15651570        event.type = KeyRelease; 
    1566         adaptKey(event, keySymbol); 
    1567         getEventQueue()->keyRelease(keySymbol, time); 
     1571        adaptKey(event, keySymbol, unmodifiedKeySymbol); 
     1572        getEventQueue()->keyRelease(keySymbol, time, unmodifiedKeySymbol); 
    15681573        keyMapClearKey(_keyMap, key); 
    15691574    }