<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Andy,<div><br></div><div>This might be just a matter of style but IMHO the limitations of the current design aren’t listed in the Summary. For example, I have to get down to the description section before I see this requirement:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ensure that user-defined mappings overwrite default ones and survive a skin change</div><div><br></div><div>There’s nothing indicating that this is currently not working (or why it’s not working). But perhaps this is something I should already know since I do spend most of my time down in the platform code.</div><div><div><br><blockquote type="cite"><div><span style="font-family: "Iosevka Fixed SS16"; font-size: 11pt;">Perhaps you could start a new thread listing some (all?) examples? I don’t think we have any existing documentation of the key bindings, so here we go:</span></div><div><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Optima-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><a href="https://github.com/andy-goryachev-oracle/jfx/tree/8314906.behavior.test/doc-files/behavior" style="color: blue; text-decoration: underline;">https://github.com/andy-goryachev-oracle/jfx/tree/8314906.behavior.test/doc-files/behavior</a></span></div></div></div></blockquote><div><br></div>That’s a long list with several platform-specific nuances. You’ll need to re-implement a big chunk of them for the table and tree view controls. In your proposal you give an example of a RichTextArea and it will also need to re-implement all of these.</div><div><br></div><div>In macOS 10.14 Apple created the <a href="https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding?language=objc">NSStandardKeyBindingResponding</a> protocol to encapsulate some of the potential binding targets. It’s overkill and doesn’t cover a bunch of common bindings like Shortcut+C for Copy. BTW, there’s a way for power-users to alter these bindings but it relies on them being global.</div><div><br></div><div>I’ll dig into the proposal a bit more but probably not before next week.</div><div><br></div><div>Martin</div><div><blockquote type="cite"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Optima-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p></o:p></span></div></div></blockquote></div><div><br></div><div><blockquote type="cite"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Optima-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p> </o:p></span></div><div id="mail-editor-reference-message-container"><div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; border-image: none; padding: 3pt 0in 0in;"><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 10pt; font-family: Calibri, sans-serif;"><b><span style="font-size: 12pt;">From:<span class="Apple-converted-space"> </span></span></b><span style="font-size: 12pt;">openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of Martin Fox <martin@martinfox.com><br><b>Date:<span class="Apple-converted-space"> </span></b>Wednesday, October 11, 2023 at 10:27<br><b>To:<span class="Apple-converted-space"> </span></b>John Hendrikx <john.hendrikx@gmail.com><br><b>Cc:<span class="Apple-converted-space"> </span></b>openjfx-dev@openjdk.org <openjfx-dev@openjdk.org><br><b>Subject:<span class="Apple-converted-space"> </span></b>Re: [Request for Comments] Behavior / InputMap<o:p></o:p></span></p></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div><div><div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">On Oct 11, 2023, at 1:03 AM, John Hendrikx <john.hendrikx@gmail.com> wrote:<o:p></o:p></span></div></div></blockquote><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">After reading John's message I realize that the InputMap proposal doesn’t list the limitations of the current design. It seems to be addressing some of the sequencing issues John mentions but doesn’t state outright that it’s doing so or why. I would set aside the proposal and focus on writing a problem statement document first.<o:p></o:p></span></div></div><div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><p style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><span style="font-size: 10.5pt; font-family: Optima-Regular;">A system to remap keys can then be left squarely in the realm of user space, and much nicer solutions can be build by users than whatever JavaFX will provide out of the box.<o:p></o:p></span></p></blockquote><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Seconded. Whatever Eclipse is doing to implement their key binding interface is deep and complex and there’s no way JavaFX could craft a solution Eclipse would use. I think that will be true for most apps that allow user customizable key bindings. And I’m pretty sure that when the user customizes a key binding Eclipse is not tracking down all of the affected controls and updating their per-instance key binding maps. Those maps have to be centralized and shared in some manner.<o:p></o:p></span></div></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><p style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><span style="font-size: 10.5pt; font-family: Optima-Regular;">So in short, what I think this should be about is:<o:p></o:p></span></p><p style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><span style="font-size: 10.5pt; font-family: Optima-Regular;">- Ensure user event handlers have priority over behavior/inputmap added ones<br>- Ensure all behavior actions are available as methods on controls<o:p></o:p></span></p></blockquote><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">I have another recommendation (which may be more of a feature request). There should be a centralized way of mapping common keys to actions to ensure a consistent vocabulary across the user interface. As an example, on many controls Shift + up arrow should map to something like “moveUpAndExtendTheSelection”. There are a lot of these standardized bindings, some of them are platform specific, and it’s a really tall order to expect all of the individual control classes to get this right.<o:p></o:p></span></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">On macOS there are two primary means of mapping a key event to an action and both are global. This means most of these mappings happen outside the individual controls and that the mappings are consistent across controls. This also addresses part of what John mentioned above; to make this work controls have to make their actions visible through callable methods.<o:p></o:p></span></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Phrased as problem statement: currently individual control classes need to separately implement a large set of standardized keyboard bindings. This is a maintenance and testing issue.<o:p></o:p></span></div></div></div><div><div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><p><span style="font-family: Optima-Regular;">- Ensure that if a key is handled by the control, that it is ONLY consumed when it actually triggers an action (navigation keys get consumed regardless, even if no focus change results, that's wrong).<o:p></o:p></span></p></blockquote><div><p><span style="font-family: Optima-Regular;">As I recall this is an issue with the traversal engine which is a maybe a separate topic (?) Was a bug ever entered on this?<o:p></o:p></span></p><p><span style="font-family: Optima-Regular;">Martin<o:p></o:p></span></p></div></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><p style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><span style="font-size: 10.5pt; font-family: Optima-Regular;">On 10/10/2023 19:54, Andy Goryachev wrote:<o:p></o:p></span></p><blockquote style="margin-top: 5pt; margin-bottom: 5pt; font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Re-sending with a smaller image (256kb limit, really?).</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div id="mail-editor-reference-message-container"><div><div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-color: currentcolor; border-image: none;"><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 10pt; font-family: Calibri, sans-serif;"><b><span style="font-size: 12pt;">From:<span class="apple-converted-space"> </span></span></b><span style="font-size: 12pt;">Andy Goryachev<span class="apple-converted-space"> </span><a href="mailto:andy.goryachev@oracle.com" style="color: blue; text-decoration: underline;"><andy.goryachev@oracle.com></a><br><b>Date:<span class="apple-converted-space"> </span></b>Tuesday, October 10, 2023 at 10:49<br><b>To:<span class="apple-converted-space"> </span></b>Michael Strauß<span class="apple-converted-space"> </span><a href="mailto:michaelstrau2@gmail.com" style="color: blue; text-decoration: underline;"><michaelstrau2@gmail.com></a><br><b>Cc:<span class="apple-converted-space"> </span></b><a href="mailto:openjfx-dev@openjdk.org" style="color: blue; text-decoration: underline;">openjfx-dev@openjdk.org</a><span class="apple-converted-space"> </span><a href="mailto:openjfx-dev@openjdk.org" style="color: blue; text-decoration: underline;"><openjfx-dev@openjdk.org></a><br><b>Subject:<span class="apple-converted-space"> </span></b>Re: [Request for Comments] Behavior / InputMap</span><o:p></o:p></p></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Dear Michael:</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Here is a use case for (re-)mapping by the user at runtime:</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><image002.jpg><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">(key mappings UI in Eclipse).</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">I can think of several other cases (mentioned in the proposal, I think) so I think we can put the concept of immutable or global InputMap to rest.</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Whether the InputMap contains the reference to its control or not is a minor implementation detail, I think.</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">-andy</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div id="mail-editor-reference-message-container"><div><div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-color: currentcolor; border-image: none;"><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 10pt; font-family: Calibri, sans-serif;"><b><span style="font-size: 12pt;">From:<span class="apple-converted-space"> </span></span></b><span style="font-size: 12pt;">openjfx-dev<span class="apple-converted-space"> </span><a href="mailto:openjfx-dev-retn@openjdk.org" style="color: blue; text-decoration: underline;"><openjfx-dev-retn@openjdk.org></a><span class="apple-converted-space"> </span>on behalf of Michael Strauß<span class="apple-converted-space"> </span><a href="mailto:michaelstrau2@gmail.com" style="color: blue; text-decoration: underline;"><michaelstrau2@gmail.com></a><br><b>Date:<span class="apple-converted-space"> </span></b>Tuesday, October 10, 2023 at 10:36<br><b>To:<span class="apple-converted-space"> </span></b><br><b>Cc:<span class="apple-converted-space"> </span></b><a href="mailto:openjfx-dev@openjdk.org" style="color: blue; text-decoration: underline;">openjfx-dev@openjdk.org</a><span class="apple-converted-space"> </span><a href="mailto:openjfx-dev@openjdk.org" style="color: blue; text-decoration: underline;"><openjfx-dev@openjdk.org></a><br><b>Subject:<span class="apple-converted-space"> </span></b>Re: [Request for Comments] Behavior / InputMap</span><o:p></o:p></p></div><div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">> Yes, one of the features the new design provides is ability to modify key mappings by the user at runtime. So yes, not only it needs to be mutable, but it also adds some APIs for exactly that.<br>><br><br>I struggle to see a use case for this feature. I can imagine that<br>there might be some use cases that call for customized input mappings,<br>but why would this translate to a _mutable_ input map? That's quite a<br>departure from the way other parts of JavaFX work.<br><br>For example, skins are also immutable. If you want to have a different<br>skin for a control, you don't somehow modify the existing skin<br>instance; instead, you'd create a new skin class (or -- somehow --<br>extend an existing skin class), and then install that new skin on your<br>control.<br><br>An input map shouldn't bind input events directly to instance methods<br>of a particular control instance. It should define the mapping of<br>events to methods symbolically:<br><br>Instead of mapping Event => instance.method(), it should map Event =><br>Control::method. The input map could then be stateless and immutable,<br>and can be set on any control instance. If you want to change the<br>mappings, just set a different input map instance. There's no need<br>that an input map would retain a reference to any particular control,<br>since the control reference can be passed into the input map just as<br>easily.</span></div></div></div></div></div></div></div></blockquote></blockquote></div></div></div></div></div></blockquote></div><br></div></body></html>