okay
Here what prints #kbdTest

c - '99 0'
z - '122 0'
x - '120 0'

in russian layout

я (z key) -  '79 0'
ч (x key) -  '71 0'
с (c key) - '65 0'

Now i wrote own test method:

testKbd
        "This test routine will print the unmodified character, its keycode,
        and the OR of all its modifier bits, until the character x is typed"
        | char event |
        char := nil.
        [true] whileTrue: [
                event := self peekEvent.
                (event notNil and: [ (event at: 1) = EventTypeKeyboard  and: [
(event at: 4) = EventKeyDown] ]) ifTrue: [
                        (String streamContents: [:s |
                                        event do: [:each | s nextPutAll: each 
printString; space].
                                s nextPutAll: '     ']) displayAt: 1...@10
                ].
         (Delay forMilliseconds: 10) wait.
        ]
----
And it works if you do:

[Sensor testKbd] fork

And! Wonderfull!
Regardless of active keyboard layout (en/ru)
it always prints same events for these keys, as following:

z - 2 <timestamp> 90 1 0 90 0 1
x - 2 <timestamp> 88 1 0 88 0 1
c - 2 <timestamp> 67 1 0 67 0 1

so, if we use these events for shortcuts, everything will work similar
regardless of keys layout.


2009/2/24 Adrian Lienhard <a...@netstyle.ch>:
> I'm looking at a Pharo core #10241 image.
>
> Adrian
>
> On Feb 24, 2009, at 10:48 , Igor Stasenko wrote:
>
>> 2009/2/24 Adrian Lienhard <a...@netstyle.ch>:
>>> Sensor kbdTest
>>>
>> "There is no implementors of kbdTest"
>>
>> :(
>>
>> What image might contain this method?
>>
>>> HTH,
>>> Adrian
>>>
>>> On Feb 24, 2009, at 09:48 , Igor Stasenko wrote:
>>>
>>>> 2009/2/24 Michael Rueger <m.rue...@acm.org>:
>>>>> Igor Stasenko wrote:
>>>>>
>>>>>> what is not very convenient is that copy/paste (as well as the
>>>>>> rest of
>>>>>> keyboard shortcuts ) is not working when keyboard layout not
>>>>>> english.
>>>>>
>>>>> If you could be so kind to tell me what comes back in slot 3 of the
>>>>> input event on your Russian keyboard if you simply type the
>>>>> equivalent
>>>>> of 'xcv' (without alt or ctrl)?
>>>>>
>>>>> I'm interested in what comes back on the keyDown and the keystroke
>>>>> event.
>>>>>
>>>>
>>>> I tried something like this
>>>>
>>>> [ | event |
>>>>  event := Sensor peekEvent.
>>>>  event ifNotNil: [
>>>>       ((event first = 2) and: [event fourth = 1] ) ifTrue: [
>>>>       Transcript show: (event third printStringRadix: 16); cr.
>>>>       ] ] ] repeat
>>>>
>>>> but it not shows anything :(
>>>> Have a snippet which i can run to show key codes?
>>>>
>>>>
>>>>
>>>>> Thanks
>>>>>
>>>>> Michael
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> Pharo-project@lists.gforge.inria.fr
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Igor Stasenko AKA sig.
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> Pharo-project@lists.gforge.inria.fr
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project@lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project@lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project@lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



-- 
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to