Tricky...trying to make hotkeys for a program without unique data
Posted: 09 May 2017, 10:57
I have what I think might be really tricky questions. First a little context, and then the questions, followed by any relevant data which might help address the questions. If it's helpful, I can provide screenshots. Sorry in advance for this post being so long. I just want to include as much relevant information as I can. Thank you in advance for your kind help!
P.S. I'm not asking anyone to write the code for me. If someone does, great, thanks, that saves me a lot of time! But I'm really just asking for help understanding a world I know very little of. (My knowledge of programming in general is basically none...I understand some very--VERY--cursory things, but little beyond that.) Thanks again for your help!
CONTEXT
I'm using the program FontCreator 10.1, and the context of these questions pertains to the OpenType Designer feature. When this window opens, there are a few buttons on the top for adding and modifying scripts. To the left is a virtual tree with various entries for scripts, features, and lookups; only the lookups are relevant for this question. Along the bottom of the window are previews and various options, none of which are relevant.
The main part of the window determines the title of the whole window, as the window title changes depending on which type of the 13 lookup types is selected. Fortunately, the structure of the window is the same for some lookups, so it actually reduces to only 6 sets of hotkeys which could be duplicated as needed for the other lookup types.
Though the layout of the 6 window‑types differs, they have similar features, namely: add buttons, delete buttons, a list box or boxes, and spin boxes/buttons. Some windows have unique features. All features and their data are listed below in the section "DATA".
LIMITS
The limits I want to place on the script focus around minimal mouse movement; thus, I want to avoid virtual clicks as much as possible. Basically, I want to be able to keep track of the mouse, rather than having it change position every time I use a hotkey. Additionally, I need to account for changes to the number and position of items in the list boxes, which further constricts the use of clicks.
QUESTIONS
Basically, here's what I would like to happen:
1. TAB cycles forward through list box entries, and SHIFT+TAB cycles backward through list box entries.
2. Arrow keys adjust x/y advance spin buttons.
3. SHIFT+Arrow keys adjust x/y placement spin buttons.
4. ALT+Arrow keys adjust second set of x/y spin buttons.
And a few questions pertaining to specific windows (see DATA below for explanation)
5. In window 2, TAB activates ClassNN: TButton14, and SHIFT+TAB activates ClassNN: TButton15.
6. CTRL+TAB cycles through tabs in window 4.
DATA
1. Window title contains: (SingleAdjustment)
Listbox ClassNN: TListBox1
Toolbar above Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
XAdvance Spin Button ClassNN: TSpTBXSpinButton1
YAdvance Spin Button ClassNN: TSpTBXSpinButton2
XPlacement Spin Button ClassNN: TSpTBXSpinButton3
YPlacement Spin Button ClassNN: TSpTBXSpinButton4
2. Window title contains: (CursiveAttachment) or (MarkToBase) or (MarkToLigature) or (MarkToMark)
First Listbox ClassNN: TListBox2
Toolbar above First Listbox ClassNN: TSpTBXToolbar2 (contains add, delete buttons)
Second Listbox ClassNN: TListBox1
Toolbar above Second Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
Next Button ClassNN: TButton14
Next Button Text: Next>
Previous Button ClassNN: TButton15
Previous Button Text: <Previous
First Xpos Spin Button ClassNN: TSpTBXSpinButton4
First Ypos Spin Button ClassNN: TSpTBXSpinButton3
Second Xpos Spin Button ClassNN: TSpTBXSpinButton1
Second Ypos Spin Button ClassNN: TSpTBXSpinButton2
3. Window title contains: (PairAdjustment)
Listbox ClassNN: TListBox1
Toolbar above Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
First XAdvance Spin Button ClassNN: TSpTBXSpinButton1
First YAdvance Spin Button ClassNN: TSpTBXSpinButton2
First XPlacement Spin Button ClassNN: TSpTBXSpinButton3
First YPlacement Spin Button ClassNN: TSpTBXSpinButton4
Second XAdvance Spin Button ClassNN: TSpTBXSpinButton8
Second YAdvance Spin Button ClassNN: TSpTBXSpinButton7
Second XPlacement Spin Button ClassNN: TSpTBXSpinButton6
Second YPlacement Spin Button ClassNN: TSpTBXSpinButton5
4. Window title contains: (ChainedContextPositioning) or (ChainingContext)
Tabs contained in ClassNN: TPageControl3 (contains 2 tabs with same ClassNN and no defining control text)
Tab 1:
First Listbox ClassNN: TListBox4
Toolbar above First Listbox ClassNN: TSpTBXToolbar1 (contains add, delete, move up, move down buttons)
Second Listbox ClassNN: TListBox3
Toolbar above Second Listbox ClassNN: TSpTBXToolbar4 (contains add, delete, move up, move down buttons)
Third Listbox ClassNN: TListBox2
Toolbar above Third Listbox ClassNN: TSpTBXToolbar3 (contains add, delete, move up, move down buttons)
Fourth Listbox ClassNN: TListBox1
Toolbar above Fourth Listbox ClassNN: TSpTBXToolbar2 (contains add, delete, move up, move down buttons)
Background fill of selected item in Fourth Listbox: 0078D7
Tab 2:
First Listbox ClassNN: TListBox1
Toolbar above First Listbox ClassNN: TSpTBXToolbar3 (contains add, delete buttons)
Second Listbox ClassNN: TListBox2
Toolbar above Second Listbox ClassNN: TSpTBXToolbar2 (contains add, delete buttons)
Third Listbox ClassNN: TListBox3
Toolbar above Third Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
5. Window title contains: (SingleSubstitution) or (MultipleSubstitution) or (Alternate) or (Ligature)
Listbox ClassNN: TListBox1
Toolbar above Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
6. Window title contains: (ReverseChainingContext)
First Listbox ClassNN: TListBox3
Toolbar above First Listbox ClassNN: TSpTBXToolbar3 (contains add, delete, move up, move down buttons)
Second Listbox ClassNN: TListBox2
Toolbar above Second Listbox ClassNN: TSpTBXToolbar2 (contains add, delete, move up, move down buttons)
Third Listbox ClassNN: TListBox1
Toolbar above Third Listbox ClassNN: TSpTBXToolbar1 (contains add, delete, move up, move down buttons)
7. Additional Global Data
A. "Add", "Delete", "Move up", and "Move down" buttons have ClassNN: TSpTBXToolbarx, where x is an integer.
In other words, WindowSpy does not detect any unique value for these buttons except for mouse position.
B. The "Add", "Delete", "Move up" and "Move down" buttons contain a gradient fill.
i. The "Add" button is generally colored green.
ii. The "Delete" button is generally colored red.
iii. The "Move up" and "Move down" arrows are generally colored blue.
C. Each set of up and down spin buttons has a unique ClassNN, but buttons within the set do not have unique ClassNN.
In other words, up1 and down1 have the same ClassNN, but up1 and up2 have different class names.
D. In List boxes, the selected item has background color D1E5FC; non-selected items have background color FFFFFF.
i. Note: see exception listed above (window 4, tab 1, listbox 4)
P.S. I'm not asking anyone to write the code for me. If someone does, great, thanks, that saves me a lot of time! But I'm really just asking for help understanding a world I know very little of. (My knowledge of programming in general is basically none...I understand some very--VERY--cursory things, but little beyond that.) Thanks again for your help!
CONTEXT
I'm using the program FontCreator 10.1, and the context of these questions pertains to the OpenType Designer feature. When this window opens, there are a few buttons on the top for adding and modifying scripts. To the left is a virtual tree with various entries for scripts, features, and lookups; only the lookups are relevant for this question. Along the bottom of the window are previews and various options, none of which are relevant.
The main part of the window determines the title of the whole window, as the window title changes depending on which type of the 13 lookup types is selected. Fortunately, the structure of the window is the same for some lookups, so it actually reduces to only 6 sets of hotkeys which could be duplicated as needed for the other lookup types.
Though the layout of the 6 window‑types differs, they have similar features, namely: add buttons, delete buttons, a list box or boxes, and spin boxes/buttons. Some windows have unique features. All features and their data are listed below in the section "DATA".
LIMITS
The limits I want to place on the script focus around minimal mouse movement; thus, I want to avoid virtual clicks as much as possible. Basically, I want to be able to keep track of the mouse, rather than having it change position every time I use a hotkey. Additionally, I need to account for changes to the number and position of items in the list boxes, which further constricts the use of clicks.
QUESTIONS
Basically, here's what I would like to happen:
1. TAB cycles forward through list box entries, and SHIFT+TAB cycles backward through list box entries.
2. Arrow keys adjust x/y advance spin buttons.
3. SHIFT+Arrow keys adjust x/y placement spin buttons.
4. ALT+Arrow keys adjust second set of x/y spin buttons.
And a few questions pertaining to specific windows (see DATA below for explanation)
5. In window 2, TAB activates ClassNN: TButton14, and SHIFT+TAB activates ClassNN: TButton15.
6. CTRL+TAB cycles through tabs in window 4.
DATA
1. Window title contains: (SingleAdjustment)
Listbox ClassNN: TListBox1
Toolbar above Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
XAdvance Spin Button ClassNN: TSpTBXSpinButton1
YAdvance Spin Button ClassNN: TSpTBXSpinButton2
XPlacement Spin Button ClassNN: TSpTBXSpinButton3
YPlacement Spin Button ClassNN: TSpTBXSpinButton4
2. Window title contains: (CursiveAttachment) or (MarkToBase) or (MarkToLigature) or (MarkToMark)
First Listbox ClassNN: TListBox2
Toolbar above First Listbox ClassNN: TSpTBXToolbar2 (contains add, delete buttons)
Second Listbox ClassNN: TListBox1
Toolbar above Second Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
Next Button ClassNN: TButton14
Next Button Text: Next>
Previous Button ClassNN: TButton15
Previous Button Text: <Previous
First Xpos Spin Button ClassNN: TSpTBXSpinButton4
First Ypos Spin Button ClassNN: TSpTBXSpinButton3
Second Xpos Spin Button ClassNN: TSpTBXSpinButton1
Second Ypos Spin Button ClassNN: TSpTBXSpinButton2
3. Window title contains: (PairAdjustment)
Listbox ClassNN: TListBox1
Toolbar above Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
First XAdvance Spin Button ClassNN: TSpTBXSpinButton1
First YAdvance Spin Button ClassNN: TSpTBXSpinButton2
First XPlacement Spin Button ClassNN: TSpTBXSpinButton3
First YPlacement Spin Button ClassNN: TSpTBXSpinButton4
Second XAdvance Spin Button ClassNN: TSpTBXSpinButton8
Second YAdvance Spin Button ClassNN: TSpTBXSpinButton7
Second XPlacement Spin Button ClassNN: TSpTBXSpinButton6
Second YPlacement Spin Button ClassNN: TSpTBXSpinButton5
4. Window title contains: (ChainedContextPositioning) or (ChainingContext)
Tabs contained in ClassNN: TPageControl3 (contains 2 tabs with same ClassNN and no defining control text)
Tab 1:
First Listbox ClassNN: TListBox4
Toolbar above First Listbox ClassNN: TSpTBXToolbar1 (contains add, delete, move up, move down buttons)
Second Listbox ClassNN: TListBox3
Toolbar above Second Listbox ClassNN: TSpTBXToolbar4 (contains add, delete, move up, move down buttons)
Third Listbox ClassNN: TListBox2
Toolbar above Third Listbox ClassNN: TSpTBXToolbar3 (contains add, delete, move up, move down buttons)
Fourth Listbox ClassNN: TListBox1
Toolbar above Fourth Listbox ClassNN: TSpTBXToolbar2 (contains add, delete, move up, move down buttons)
Background fill of selected item in Fourth Listbox: 0078D7
Tab 2:
First Listbox ClassNN: TListBox1
Toolbar above First Listbox ClassNN: TSpTBXToolbar3 (contains add, delete buttons)
Second Listbox ClassNN: TListBox2
Toolbar above Second Listbox ClassNN: TSpTBXToolbar2 (contains add, delete buttons)
Third Listbox ClassNN: TListBox3
Toolbar above Third Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
5. Window title contains: (SingleSubstitution) or (MultipleSubstitution) or (Alternate) or (Ligature)
Listbox ClassNN: TListBox1
Toolbar above Listbox ClassNN: TSpTBXToolbar1 (contains add, delete buttons)
6. Window title contains: (ReverseChainingContext)
First Listbox ClassNN: TListBox3
Toolbar above First Listbox ClassNN: TSpTBXToolbar3 (contains add, delete, move up, move down buttons)
Second Listbox ClassNN: TListBox2
Toolbar above Second Listbox ClassNN: TSpTBXToolbar2 (contains add, delete, move up, move down buttons)
Third Listbox ClassNN: TListBox1
Toolbar above Third Listbox ClassNN: TSpTBXToolbar1 (contains add, delete, move up, move down buttons)
7. Additional Global Data
A. "Add", "Delete", "Move up", and "Move down" buttons have ClassNN: TSpTBXToolbarx, where x is an integer.
In other words, WindowSpy does not detect any unique value for these buttons except for mouse position.
B. The "Add", "Delete", "Move up" and "Move down" buttons contain a gradient fill.
i. The "Add" button is generally colored green.
ii. The "Delete" button is generally colored red.
iii. The "Move up" and "Move down" arrows are generally colored blue.
C. Each set of up and down spin buttons has a unique ClassNN, but buttons within the set do not have unique ClassNN.
In other words, up1 and down1 have the same ClassNN, but up1 and up2 have different class names.
D. In List boxes, the selected item has background color D1E5FC; non-selected items have background color FFFFFF.
i. Note: see exception listed above (window 4, tab 1, listbox 4)