Fake typing?

Mike Bonner bonnmike at gmail.com
Mon Jan 12 17:28:57 EST 2015


If you can determine which map file is used, then you could maybe parse the
file and figure things out that way.

On Mon, Jan 12, 2015 at 3:27 PM, Mike Bonner <bonnmike at gmail.com> wrote:

> Interesting.. Correct me if i'm wrong though. (which is likely) a Q is a Q
> is a Q, which is why it would still be 81, even though the keyboard scan
> code would be different, but then mapped to "Q" based on the layout.
>  (meaning pressing the right key for Q on the keyboard would be mapped to
> 81)
>
> If the purpose is to determine the current keyboard layout, (you mentioned
> that somewhere above) I wonder if shell will work, though that has the
> problem that the environment from shell and in an x session may be
> different.
>
> You might mess around with setxkbmap -query from shell()
> also might look at the environment variables and see whats there.
>
> I don't think you can force a keyboard to send a key unless its a
> programmable, but I may be wrong on that.  I messed with dispatching
> keydown and rawkeydown and dispatching things with some varied combinations
> of numtochar, chartonum and the newer but related native functions, don't
> see a way to force the behavior you wish.
>
> The best option would be to tell the user to press a specific key and see
> what pops out, and use that to determine layout.. assuming you can't get at
> the info programmatically. <-- (spelling?)
>
> On Mon, Jan 12, 2015 at 2:42 PM, Richmond <richmondmathewson at gmail.com>
> wrote:
>
>> On 12/01/15 23:19, Richmond wrote:
>>
>>> On 12/01/15 23:00, Richmond wrote:
>>>
>>>> On 12/01/15 22:40, Mike Bonner wrote:
>>>>
>>>>> Would the type command do what you want?
>>>>>
>>>>>  From the dictionary:
>>>>> Note: As the type command is designed to emulate exactly what happens
>>>>> when
>>>>> a user types a key on the keyboard, the rawKeyDown, keyDown, rawKeyUp
>>>>> and
>>>>> keyUp messages are sent by the command. If these messages are blocked,
>>>>> the
>>>>> text will not appear in the selected field.
>>>>>
>>>>
>>>> It's a thought.
>>>>
>>>> This works very well indeed:
>>>>
>>>> on mouseUp
>>>>   type "Q"
>>>> end mouseUp
>>>>
>>>> on rawKeyDown RAWK
>>>>   put RAWK
>>>> end rawKeyDown
>>>>
>>>> I get 81
>>>> ------------------------------
>>>>
>>>> Richmond.
>>>>
>>>>
>>> However, if I select a different keyboard layout, say "AZERTY" (French)
>>> and run the same script I still get 81, which means that the real
>>> rawKeyDown
>>> is NOT being delivered (it should be 65).
>>>
>>
>> What is needed is NOT to TYPE "Q", but to be able to send a rawKey
>> command ???????????
>>
>> Richmond.
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>



More information about the use-livecode mailing list