OptiKey
OptiKey copied to clipboard
Dynamic keyboard customisation tool
@AdamRoden Hi Adam. I received an email from @Hizoul who has created an excellent online dynamic keyboard editing tool: https://github.com/Hizoul/optikey-boardlayout
I've included some screenshots below. Can you take a look and see what could be added so that all functionality is covered. I will then work with him to flesh out the tool. Thank you!
Direct link to tool: https://hizoul.github.io/optikey-boardlayout/
Oh, this looks great!
Two comments after a very brief look: 1 - When setting the Symbol for a key, it would be good to have a pre-populated list of available symbols in a dropdown field (it's currently free text). It shouldn't be too hard to extract these with a regex script from https://github.com/OptiKey/OptiKey/blob/master/src/JuliusSweetland.OptiKey.Core/Resources/Icons/KeySymbols.xaml
2 - The first time I load the page, there's a bug with key locations - they jump when you first click on a key. See https://www.loom.com/share/1aa2376d0345452d8e0c656950acc731. This is in chrome - in firefox, there's a similar issue but it seems to be correct at first, then you click and it goes wrong, then you click again and it's fine forever more.
I like where this is going. The tool is based on the dynamic keyboards from before I got involved, so to cover all functionality it will need all the new keyboard properties I've added as well as the ones in my current PR. Once we review and merge my PR I can finalize a list of properties.
The current list:
PersistNewState: true or false to indiate whether the size and position of this keyboard will be saved WindowState: Floating, Docked, Maximised - if not declared the previous value or saved default will be used DockSize: Full, Collapsed - if not declared the previous value or saved default will be used Position: TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight - if not declared the previous value or saved default will be used Width and Height: -9999 to 9999. % implies percent of screen. if negative then use the sum of the value and the screen's dimension i.e. if a Width of -300 is sent and the screen is 1920 wide then the keyboard width will be set to 1620 by way of ((-300) + (1920) = (1620)) Horizontal and Vertical Offset: -9999 to 9999. % implies percent of screen. if negative then offset left or up BackgroundColor BorderColor
KeyGroup may have the following optional attributes: BackgroundColor KeyDisabledBackground KeyDownBackground ForegroundColor KeyDisabledForeground KeyDownForeground Opacity - a numeric value between 0 and 1 where 0 is transparent and 1 is fully opaque KeyDisabledOpacity KeyDownOpacity AutoScaleToOneKeyWidth - only required to modify scaling behavior when key width is greater than 1. if not declared it will default to "true" AutoScaleToOneKeyHeight - only required to modify scaling behavior when key height is greater than 1. if not declared it will default to "true" SharedSizeGroup - only required to break out a key, or set of keys, to size separately, otherwise size grouping is determined automatically UsePersianCompatibilityFont UseUnicodeCompatibilityFont UseUrduCompatibilityFont LockOnTime - milliseconds from when gaze is detected on key to the start of the progress animation CompletionTime - milliseconds from the start of the progress animation to the key being triggered RepeatDelay - how long you need to hold a key down for before it starts repeating RepeatRate - how quickly the key repeats itself once it starts KeyGroup Examples: <KeyGroup Name="Urdu" BackgroundColor="black" Opacity="1" KeyDownBackground="gray" KeyDownOpacity="1" UseUnicodeCompatibilityFont="true" UseUrduCompatibilityFont="true" /> <KeyGroup Name="GREEN" BackgroundColor="green" KeyDownBackground="gray" /> <KeyGroup Name="RED" BackgroundColor="red" KeyDownBackground="gray" />
Content/Keys
Content may have 0, 1 or many occurrences of each of the following elements: DynamicKey Scratchpad SuggestionCol SuggestionRow
Content items may have 0 or 1 occurence of the following attributes: Row - if not declared it will be set by the positioning algorithm Col - if not declared it will be set by the positioning algorithm Width - if not declared it will default to 1 Height - if not declared it will default to 1 Example: <Scratchpad Row="0" Col="0" Width="8" Height="1" />
DynamicKey may have 0 or 1 occurrence of the following attributes: Row - if not declared it will be set by the positioning algorithm Col - if not declared it will be set by the positioning algorithm Width - if not declared it will default to 1 Height - if not declared it will default to 1 Label - either set this, the Symbol, or both. This value become the text value on the created Key. ShiftDownLabel - only required to display an alternate text value when the shift key is down. Symbol - this is the image on the key Any of the attributes of KeyGroup items
DynamicKey items may have 0, 1 or many occurence of the following element: KeyGroup - the matching KeyGroup settings will be applied, but they will not override individual item settings
DynamicKey may have 0, 1 or many occurrences of the following command elements: Action - an action key ChangeKeyboard - a built in or dynamic keyboard KeyDown - a character or action key to press and not release KeyToggle - a character or action key change state KeyUp - a character, action key, or KeyGroup to release. Any down keys having a matching KeyGroup will be released Loop - a wrapper used to enclose a set of commands which are to be performed repetitively Text - a character or string of characters to type Wait - time to wait in milliseconds before executing the next command
ChangeKeyboard command may have the following optional attribute: BackReturnsHere - if "true" the back key on the destination keyboard will return here. default to "true"
Loop command may have the following optional attribute: Count - if a value greater than 0 is not declared the key will remain down and the commands will loop perpetually until the key is triggered to stop
Loop command may have 0, 1 or many occurrences of any of DynamicKey command elements Loop - loops can be nested within other loops Wait - if a wait is not declared somewhere within the loop then a default delay will be applied to throttle the loop Example: <Loop Count="0"> <KeyToggle>x</KeyToggle> <Wait>500</Wait> </Loop>
*For valid colors refer to https://docs.microsoft.com/en-us/dotnet/api/system.drawing.color
Thanks Adam. I'll review your PR on Monday and then update this thread
On Fri, 21 Feb 2020, 14:53 AdamRoden, [email protected] wrote:
I like where this is going. The tool is based on the dynamic keyboards from before I got involved, so to cover all functionality it will need all the new keyboard properties I've added as well as the ones in my current PR. Once we review and merge my PR I can finalize a list of properties.
The current list:
PersistNewState: true or false to indiate whether the size and position of this keyboard will be saved WindowState: Floating, Docked, Maximised - if not declared the previous value or saved default will be used DockSize: Full, Collapsed - if not declared the previous value or saved default will be used Position: TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight - if not declared the previous value or saved default will be used Width and Height: -9999 to 9999. % implies percent of screen. if negative then use the sum of the value and the screen's dimension i.e. if a Width of -300 is sent and the screen is 1920 wide then the keyboard width will be set to 1620 by way of ((-300) + (1920) = (1620)) Horizontal and Vertical Offset: -9999 to 9999. % implies percent of screen. if negative then offset left or up BackgroundColor BorderColor
KeyGroup may have the following optional attributes: BackgroundColor KeyDisabledBackground KeyDownBackground ForegroundColor KeyDisabledForeground KeyDownForeground Opacity - a numeric value between 0 and 1 where 0 is transparent and 1 is fully opaque KeyDisabledOpacity KeyDownOpacity AutoScaleToOneKeyWidth - only required to modify scaling behavior when key width is greater than 1. if not declared it will default to "true" AutoScaleToOneKeyHeight - only required to modify scaling behavior when key height is greater than 1. if not declared it will default to "true" SharedSizeGroup - only required to break out a key, or set of keys, to size separately, otherwise size grouping is determined automatically UsePersianCompatibilityFont UseUnicodeCompatibilityFont UseUrduCompatibilityFont LockOnTime - milliseconds from when gaze is detected on key to the start of the progress animation CompletionTime - milliseconds from the start of the progress animation to the key being triggered RepeatDelay - how long you need to hold a key down for before it starts repeating RepeatRate - how quickly the key repeats itself once it starts KeyGroup Examples:
Content/Keys
Content may have 0, 1 or many occurrences of each of the following elements: DynamicKey Scratchpad SuggestionCol SuggestionRow
Content items may have 0 or 1 occurence of the following attributes: Row - if not declared it will be set by the positioning algorithm Col - if not declared it will be set by the positioning algorithm Width - if not declared it will default to 1 Height - if not declared it will default to 1 Example:
DynamicKey may have 0 or 1 occurrence of the following attributes: Row - if not declared it will be set by the positioning algorithm Col - if not declared it will be set by the positioning algorithm Width - if not declared it will default to 1 Height - if not declared it will default to 1 Label - either set this, the Symbol, or both. This value become the text value on the created Key. ShiftDownLabel - only required to display an alternate text value when the shift key is down. Symbol - this is the image on the key Any of the attributes of KeyGroup items
DynamicKey items may have 0, 1 or many occurence of the following element: KeyGroup - the matching KeyGroup settings will be applied, but they will not override individual item settings
DynamicKey may have 0, 1 or many occurrences of the following command elements: Action - an action key ChangeKeyboard - a built in or dynamic keyboard KeyDown - a character or action key to press and not release KeyToggle - a character or action key change state KeyUp - a character, action key, or KeyGroup to release. Any down keys having a matching KeyGroup will be released Loop - a wrapper used to enclose a set of commands which are to be performed repetitively Text - a character or string of characters to type Wait - time to wait in milliseconds before executing the next command
ChangeKeyboard command may have the following optional attribute: BackReturnsHere - if "true" the back key on the destination keyboard will return here. default to "true"
Loop command may have the following optional attribute: Count - if a value greater than 0 is not declared the key will remain down and the commands will loop perpetually until the key is triggered to stop
Loop command may have 0, 1 or many occurrences of any of DynamicKey command elements Loop - loops can be nested within other loops Wait - if a wait is not declared somewhere within the loop then a default delay will be applied to throttle the loop Example:
x 500
*For valid colors refer to https://docs.microsoft.com/en-us/dotnet/api/system.drawing.color
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OptiKey/OptiKey/issues/645?email_source=notifications&email_token=ABEA7ANGVRM4GLBOTSBHXUTRD7MELA5CNFSM4KY62352YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMSYL2A#issuecomment-589661672, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEA7ANGEJYZYYZ6M7TYIXTRD7MELANCNFSM4KY6235Q .
@kmcnaught I'll work on both your remarks in the following week. I already parsed the XML for the Action select so doing the same for Symbols should work too :) @AdamRoden I scanned through the list and the new stuff should definitely be coverable. Let me know when you have the final list and I'll see to add it :)
@Hizoul I have merged in the latest dynamic keyboard changes from this PR: https://github.com/OptiKey/OptiKey/pull/643
Please let me know if you would like anything to be clarified. There is a pre-release with the new changes as v3.0.4 which I will release here now: https://github.com/OptiKey/OptiKey/releases
@kmcnaught I addressed both of your comments and updated the app. Let me know if the problem with resizing should persist! I'll update again when I finished the list from @AdamRoden.
Small update: I have adjusted the app to the new XML format and added the KeyGroup override properties for DynamicKeys. Multiple Actions/Texts/Loops and KeyGroups are changes larger than I anticipated and will follow sometime in the following weeks.
@Hizoul It is looking good! I tried it out just now and have 3 comments:
- Some fields need to be XML attributes rather than elements
- The text box containing the full XML file does not order by row and column
- I am replacing CompletionTime, RepeatDelay, and RepeatRate with a single comma-delimited attribute called CompletionTimes.
Please refer to my version of the wiki for the most current information and examples: https://github.com/AdamRoden/OptiKey/wiki/Creating-and-Using-Dynamic-Keyboards
@Hizoul Thank you for the update. Looks great. On top of @AdamRoden 's feedback I noticed one thing (which may be user error)...
If I select a key and change it from a Text key to an action key (by checking isAction) - if I set a symbol and action the preview does not update and instead shows the old text?
@JuliusSweetland Not a user error, the checkboxes were buggy. The current version changed this to a dropdown, should work better now.
@AdamRoden 1., 2. and 3. are fixed.
I also added the new DynamicKey functionality and KeyGroups. All new features should be supported now (provided that I did not accidentally overread some part of the spec). I do have one question regarding the KeyGroup element as a child of a DynamicKey. My understanding is that it should look like the example below and then the key will take over the attributes of the KeyGroup unless overriden. At least this is how I implemented it but since you specify that it has two different uses depending on where it stands I am afraid I have misunderstood how it should be used.
<KeyGroup Name="Red Keys" BackgroundColor="Red" />
...
<DynamicKey Row="6" Col="10">
<Label>BackWithReturnFalse</Label>
<ChangeKeyboard BackReturnsHere="false">HackerKeyboardSymbols2</ChangeKeyboard>
<KeyGroup Name="Red Keys" />
</DynamicKey>
And of course thanks again for your contributions to OptiKey @AdamRoden , everything I thought would be nice to have for the custom keyboards is now possible and even more!
Fantastic, thanks so much!
On Thu, 26 Mar 2020, 19:06 Hizoul, [email protected] wrote:
@JuliusSweetland https://github.com/JuliusSweetland Not a user error, the checkboxes were buggy. The current version changed this to a dropdown, should work better now.
@AdamRoden https://github.com/AdamRoden 1., 2. and 3. are fixed.
I also added the new DynamicKey functionality and KeyGroups. All new features should be supported now (provided that I did not accidentally overread some part of the spec). I do have one question regarding the KeyGroup element as a child of a DynamicKey. My understanding is that it should look like the example below and then the key will take over the attributes of the KeyGroup unless overriden. At least this is how I implemented it but since you specify that it has two different uses depending on where it stands I am afraid I have misunderstood how it should be used.
... HackerKeyboardSymbols2 And of course thanks again for your contributions to OptiKey @AdamRoden https://github.com/AdamRoden , everything I thought would be nice to have for the custom keyboards is now possible and even more!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OptiKey/OptiKey/issues/645#issuecomment-604626681, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEA7APF3AUUS4DZMLSSBXLRJORSLANCNFSM4KY6235Q .
@AdamRoden Are you happy with the new version? You have more intimate knowledge of the dynamic keyboards than I do so I'd appreciate your input.
@JuliusSweetland @Hizoul It's pretty good.
The global setting for width and height need to allow the "%" symbol. I cannot create a KeyGroup. Clicking "Add" triggers the screen to go a blank. I cannot edit the tilde key. The "Label" setting for a key should not be a dropdown type option. It is three fields and all three can be used together. The fields are: Label, ShiftDownLabel, and Symbol.
The KeyGroup in the key settings should be <KeyGroup>SampleName</KeyGroup>
That's all for now.
@AdamRoden Fixed all new remarks and updated the build, let me know if there's more that needs fixing!
@Hizoul Great work! Here are a couple more corrections and suggestions.
- Change 'CompletionTime' to 'CompletionTimes' and make it allow commas in the value
- If you add KeyGroup to a key without having first creating it in the Key Group section, it generates an element with null as the value. Ideally, a name should be required before triggering the creation of a KeyGroup.
- The File section cannot be collapsed
- The lack of styling makes it confusing what level things are on. Indentation and heading differentiation would really help.
Hi @AdamRoden, 1-3 are fixed. For 2 I name the Keygroups "Keygroup #x" per default in case no name was entered yet to not clutter the UI more but guarantee correct function. I tried to address 4 by doing the following:
- Headings and subheadings font size increased
- Nested expansion panels idented
- Slight color coding of panels and subpanels to improve differentiability
@Hizoul @JuliusSweetlandhi disabled person who uses optikey this tool needs to have a KeyToggle option in the actions drop down so that it means look at it until the dwell fills up press 'a' or 'Shift' then look at it until the dwell fills up a second time and unpress 'a' or 'Shift'. the only option included requires you to fill the dwell 3 times which can be annoying.
Thanks for developing this! when the boardlayout is done I believe it will used by more people as they won't be afraid of the 'programming' parts
@chrisdahalo Sorry to keep you waiting this long. I just added the KeyToggle option to the dropdown.