• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[OT?] Problem with keyboard layout states (bug?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT?] Problem with keyboard layout states (bug?)


  • Subject: [OT?] Problem with keyboard layout states (bug?)
  • From: "Øistein E. Andersen" <email@hidden>
  • Date: Fri, 30 Jun 2006 16:37:49 +0200

This might be off topic, but I did not find a more appropriate list. Feel free to redirect my question somewhere else.

Given the following minimal keyboard layout:

><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
><keyboard group="126" id="-18948" name="Test">
>    <layouts>
>        <layout first="0" last="0" modifiers="mod" mapSet="map" />
>    </layouts>
>    <modifierMap id="mod" defaultIndex="0">
>        <keyMapSelect mapIndex="0">
>            <modifier keys="" />
>        </keyMapSelect>
>    </modifierMap>
>    <keyMapSet id="map">
>        <keyMap index="0">
>            <key code= "36" output="&#x000d;" /> <!-- CR (for dead keys to work) -->
>            <key code=  "7" action="x" />
>            <key code= "16" action="y" />
>            <key code= "49" action=" " />
>        </keyMap>
>    </keyMapSet>
>    <actions>
>        <action id="x">
>            <when state="none" next="x" />
>        </action>
>        <action id="y">
>            <when state="none" output="y" next="y" />
>        </action>
>        <action id=" ">
>            <when state="none" output=" " />
>            <when state="x" output="x(x)" />
>            <when state="y" output="(y)" />
>        </action>
>    </actions>
>    <terminators>
>        <when state="x" output="x" />
>    </terminators>
></keyboard>

The keys x, y and space are associated with the actions x, y and " ", respectively.

Whenever x is pressed, the keyboard enters the state x regardless of the previous state, as expected.

When y is pressed, the keyboard enters state y unless it was previously in state x, whereas I would have expected state y in all cases.

Test cases: 1) yy+space => "yy(y)".  2) x+y+space => "xy " and not "xy(y)".

The distinguishing feature seems to be whether the state is associated with a terminator (in which case the keyboard always enters the next state as specified) or not (in which case the keyboard unexpectedly enters the state none if it was previously in a state associated with a terminator).

This behaviour surprises me, and it does not seem to be documented in TN2056. Is this a bug or a feature?

--
Øistein E. Andersen
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: how do I make sure a certain app opens a file without using openFile: withApplication:?
  • Next by Date: Re: Compositing to custom view in Cocoa
  • Previous by thread: Re: Single selection and bindings
  • Next by thread: Core Data and Bindings - Problem accessing attributes of related entity
  • Index(es):
    • Date
    • Thread