Jump to content

[Resolved] hotkeying numerous button controls


Recommended Posts

I'm attempting to build a program that allows a few of our employees with physical disabilities to more easily notate customer accounts and the general design is they have a ton of keywords that they can select/1 click and it will add that word to their block of notes to which they can 1 click and it post those notes into the account or put them to the clipboard for use elsewhere, tracking tickets, emails, escalations, etc.

My problem that I"m running into is 2 fold.

With minimal use of the keyboard or mouse - what is the best way to put tons of controls on a screen that a user with a physical disability could easily utilize?

How in the world would you hotkey that so they could 1 key press and get a whole word?

So far what I have built is just a mass GUI of buttons that the user can 1 click and it add that word to an edit box, but I'm trying to construct a way that literally...1 key on the keyboard (while the program is selected) and it fires the control for that button.

Does that make sense?

I'm sure there are other programs out there that can do this already, but we are having to develop this in house (cheaper, faster, more customized, etc).

Any theories, ideas or concepts would be highly appreciated.

Thanks.

-Nick

edit:

to better explain - there are currently 50~ keybuttons with job specific keywords. Simple things like 'i' or 'me' etc will not be in the list.

Edited by xeroTechnologiesLLC
Link to comment
Share on other sites

Store a list of keycodes, descriptions, and whatever useful information you can think of for the user and program internally.

$key[0][0]= '1B', $key[0][1]= 'ESCAPE', $key[0][2]= '{esc}';[0]code, [1]namestring, [2]sendname

Give the user a gui to assign keys, and functions of keys.

Each function type would have it's own members used in a special way for that type. I store all my function data in a function $func[$id][$data]. So a function like computer voice would store the narrator, rate, volume, and output. I store constant and variable data programmable by the user. Lets not forget function type which is stored in $func[$id][0]. A function that would send keys might store [1]variable sent before constant, [2]constant output, [3]variable sent after constant [4]send speed, [5]hold speed, [6]0/1 raw. The possibilities with this sort of thing are endless. I'm 13k lines into it (not including the gui text files) and it's still not complete.

Here is a file I load into a key[$id][$data] array.

1B
ESC
{esc}
70
F1
{F1}
71
F2
{F2}
72
F3
{F3}
73
F4
{F4}
74
F5
{F5}
75
F6
{F6}
76
F7
{F7}
77
F8
{F8}
78
F9
{F9}
79
F10
{F10}
7A
F11
{F11}
7B
F12
{F12}
C0
`
{`}
31
1
1
32
2
2
33
3
3
34
4
4
35
5
5
36
6
6
37
7
7
38
8
8
39
9
9
30
0
0
BD
-
{-}
BB
=
{=}
08
BACKSPACE
{backspace}
09
TAB
{tab}
51
Q
q
57
W
w
45
E
e
52
R
r
54
T
t
59
Y
y
55
U
u
49
I
i
4F
O
o
50
P
p
DB
[
{[}
DD
]
{]}
DC

{}
14
CAPSLOCK
{capslock}
41
A
a
53
S
s
44
D
d
46
F
f
47
G
g
48
H
h
4A
J
j
4B
K
k
4C
L
l
BA
;
{;}
DE
'
{'}
0D
ENTER
{enter}
5A
Z
z
58
X
x
43
C
c
56
V
v
42
B
b
4E
N
n
4D
M
m
BC
,
{,}
BE
.
{.}
BF
/
{/}
20
SPACEBAR
{space}
2C
PRINT-SCREEN
{printscreen}
91
SCROLL-LOCK
{scrolllock}
13
PAUSE
{pause}
2D
INSERT
{ins}
2E
DEL
{del}
24
HOME
{home}
23
END
{end}
21
PG UP
{pgup}
22
PG DOWN
{pgdn}
26
UP ARROW
{up}
28
DOWN ARROW
{down}
25
LEFT ARROW
{left}
27
RIGHT ARROW
{right}
67
7 NP
{numpad7}
68
8 NP
{numpad8}
69
9 NP
{numpad9}
64
4 NP
{numpad4}
65
5 NP
{numpad5}
66
6 NP
{numpad6}
61
1 NP
{numpad1}
62
2 NP
{numpad2}
63
3 NP
{numpad3}
60
0 NP
{numpad0}
6F
/ NP
{numpaddiv}
6A
* NP
{numpadmult}
6D
- NP
{numpadsub}
6B
+ NP
{numpadadd}
6E
. NP
{numpaddot}
5B
L Windows
{LWIN}
5C
R Windows
{RWIN}
90
#LOCK
{numlock}
7C
F13
{F13}
7D
F14
{F14}
7E
F15
{F15}
7F
F16
{F16}
80
F17
{F17}
81
F18
{F18}
82
F19
{F19}
83
F20
{F20}
84
F21
{F21}
85
F22
{F22}
86
F23
{F23}
87
F24
{F24}
01
Left mouse
z
02
Right mouse
z
04
Middle mouse
z
05
X1 mouse
z
06
X2 mouse
z
0C
CLEAR
z
6C
Separator
z
2A
PRINT
z
29
SELECT
z
2B
EXECUTE
z
500
Wheel Down
z
501
Wheel Up
z
A0
L SHIFT
{LSHIFT}
A1
R SHIFT
{rshift}
A2
L CTRL
{LCTRL}
A3
R CTRL
{RCTRL}
A4
L ALT
{LALT}
A5
R ALT
{RALT}
10
SHIFT
{shift}
11
CTRL
{ctrl}
12
ALT
{alt}
XX
UNSET
{unset}

Macros are a function type, but a different array. $macro[$id][$command][$data]. I'm not sure exactly what you want.

I should be able to help with what you are trying to do, but I'm so busy, can't get my head straight around all of this(I'm still working on it), and the girlfriend wants to go out, lol. Check out Runner, it's $9.99 and free to members of this forum. You could use it as comparison to your project too. Good luck. I'll try to find away to help more. Forgive me for being so scattered.

Edited by Xandy
Link to comment
Share on other sites

Xandy,

No apologies necessary. Have you seen some of the crap I've posted? Talk about scattered! LOL

I will check out Runner for sure and see what I can develop.

I scrapped the idea of putting 100 buttons on the screen for something that may be even faster and easier to keep updated as our services and accounts expand.

The thought occurred to me...what if we take on a whole new service as a company that will bring all new keywords? The program has to be dynamic and fluid.

So I'm opting for this as a starting point and will have it built for testing by Monday...

Each service we offer, plus some general keywords, will be placed in 2 list boxes in tabs. List box on the left will be A - N and then the other list box will be O - Z keywords. It will be like this for each service.

User will select the word they want, then hit a hotkey/click a single button in the middle of the screen and it will add that keyword to their notes they have to enter into our billing services.

Example code below...I apologize for the ugliness of it...When I'm in GUI design mode I'm not in clean code mode quite yet. LOL

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=X:ETXDepartmentsCC-ROCProject ManagementProject ArchiveNote BuilderfrmNoteBuilder.kxf
$frmNoteBuilder = GUICreate("Note Builder", 793, 574, 192, 114)
$edtNoteBox = GUICtrlCreateEdit("", 8, 32, 361, 497)
GUICtrlSetData(-1, "edtNoteBox")
$lblNotes = GUICtrlCreateLabel("Notes", 8, 8, 37, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$btnPosttoBilling = GUICtrlCreateButton("Post Notes to Billing (F12)", 8, 536, 147, 25)
$btnCopy = GUICtrlCreateButton("Copy Notes (F8)", 272, 536, 99, 25)
$tabHotkeys = GUICtrlCreateTab(424, 0, 361, 569)
$tabGeneral = GUICtrlCreateTabItem("General")
$lstGen1 = GUICtrlCreateList("", 432, 32, 177, 526)
$lstGen2 = GUICtrlCreateList("", 616, 32, 161, 526)
$tabPhone = GUICtrlCreateTabItem("Phone")
$lstPh1 = GUICtrlCreateList("", 432, 32, 177, 526)
$lstPh2 = GUICtrlCreateList("", 616, 32, 161, 526)
$tabData = GUICtrlCreateTabItem("Data")
$lstData1 = GUICtrlCreateList("", 432, 32, 177, 526)
$lstData2 = GUICtrlCreateList("", 616, 32, 161, 526)
$tabVideo = GUICtrlCreateTabItem("Video")
$lstVid1 = GUICtrlCreateList("", 432, 32, 177, 526)
$lstVid2 = GUICtrlCreateList("", 616, 32, 161, 526)
$tabEmail = GUICtrlCreateTabItem("Email")
$lstEmail1 = GUICtrlCreateList("", 432, 32, 177, 526)
$lstEmail2 = GUICtrlCreateList("", 616, 32, 161, 526)
$tabHomeSecurity = GUICtrlCreateTabItem("Security")
$lstSec1 = GUICtrlCreateList("", 432, 32, 177, 526)
$lstSec2 = GUICtrlCreateList("", 616, 32, 161, 526)
GUICtrlCreateTabItem("")
$btnAdd = GUICtrlCreateButton("F9", 384, 216, 27, 25)
$lblAdd = GUICtrlCreateLabel("ADD", 384, 192, 30, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$btnClear = GUICtrlCreateButton("Clear (F5)", 176, 536, 75, 25)
Dim $frmNoteBuilder_AccelTable[4][2] = [["{F12}", $btnPosttoBilling],["{F8}", $btnCopy],["{F9}", $btnAdd],["{F5}", $btnClear]]
GUISetAccelerators($frmNoteBuilder_AccelTable)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

Any thoughts on the layout? Ideas for expansion?

Link to comment
Share on other sites

Well it looks interesting. It is to enable handicap members to fulfill a service. I am interested to see how this is used, and if I can assimilate it into Runner general purpose. I enable a handicap member (in theory) by granting triggers of functions. Triggers include hotkeys and mouse combinations, time-of-day, and macro conditions. For some reason I can't handle this, I am making this all about me.

Here is what I want to say: I looked at it, what you are setting up is more professional then my setup. I'm not very good with guis I use a general purpose function to create my gui dialogs from a file. I never used Koda, I wasn't sure if I could use it to return controls to array indexes, and it looked like the gui code was still going to be part of the code, I wanted the gui definitions to be loaded from a file, and allow an advanced user to create their own versions. Koda, I don't really know anything about that.

I am interested in empowering the handicap, that is certainly a goal of Runner. I don't understand exactly what you are doing yet, but I could benefit from learning more.

That said, I'm not sure what to say. Keep up the good work!

Edited by Xandy
Link to comment
Share on other sites

If you are having trouble fitting lots of controls on a gui, consider having tabs like you have with additional page <, > buttons.

And I think I get it, hotkeys to send key strings. Ya make it accept a setting file, maybe 2 or more files, one for string definitions and one for user_hotkey settings. Is that how to do it? In Runner you would save a macro to send string to a target, and save your hotkey preset file, with a hotkey set to that macro. I have a limited intelligence, but that's how I did it.

Your program could load a preset for the user, and a string definition file. It could even acquire definition files off of your website. Depending how you wanted to make your program dynamic.

Edited by Xandy
Link to comment
Share on other sites

Xandy,

Thanks for the return input and encouragement.

I'm already working on a radial menu program that has macros built into it. When it is ready I'll show off some of the code for that you may find useful in your own programs.

As for using Koda and arrays to build controls you absolutely can.

The only reason I use Koda initially is to get the phase 1 raw design. Once that is done I usually go back and build 1 array for all of my forms and dump all the controls into it.

Example:

$forms_array[4][11]

where $forms_array[1][1 through 10] are all the controls on the MAIN GUI form

$forms_array[2][1 through 10] are all the controls on the SETTINGS GUI form

etc.

the only downside that i have found for this is you sometimes create elements you don't ever use, in that the array's 2nd element (# of controls on the form) has to equal the highest number of controls on any of the forms in your project.

I'm not sure if you would find this useful for your project or not, but I tend to lean on that method more frequently nowadays as I usually incorporate color controls into the program as well.

But as for this particular project, its entire purpose is to help the user create notes, as that is a primary function of our agents job that is often not done or done in a manner that is absolutely illegible to anyone other than them. :/

It can then link to our billing software, go to the notes portion of the account and then cycle through a process to post the notes into the account.

That's pretty much it.

As for macros and such, again, building another separate radial menu program for that.

Thanks again for the input. :D

Link to comment
Share on other sites

I am having 1 issue where I click on the list box, hit the add button the item adds to the edit box no problems. But when I click in the edit box, then back over to the list box - the program closes - no error messages.

Here is the code for just the add button.

Case $btnAdd
    ; find out which tab is active, then use that to find out what is selected
    ; make sure to clear the selection every time so there is no double selections
    ; current tab
    $iCurrTab = GUICtrlRead($tabHotkeys)
    ; if the tab has changed
    If $iCurrTab <> $iLastTab Then
     Switch $iCurrTab
      Case 0
       $temp = GUICtrlRead($lstGen1)
        If $temp = "" Then
         $temp = GUICtrlRead($lstGen2)
        EndIf
       $prev_edt = GUICtrlRead($edtNoteBox)
;~      _BOX($prev_edt & " " & $temp)
       GUICtrlSetData($edtNoteBox, $prev_edt & " " & $temp)
       _GUICtrlListBox_SetCurSel($lstGen1, -1)
       _GUICtrlListBox_SetCurSel($lstGen2, -1)
      Case 1
       $temp = GUICtrlRead($lstPh1)
        If $temp = "" Then
         $temp = GUICtrlRead($lstPh2)
        EndIf
       $prev_edt = GUICtrlRead($edtNoteBox)
;~      _BOX($prev_edt & " " & $temp)
       GUICtrlSetData($edtNoteBox, $prev_edt & " " & $temp)
       _GUICtrlListBox_SetCurSel($lstPh1, -1)
       _GUICtrlListBox_SetCurSel($lstPh2, -1)
      Case 2
       $temp = GUICtrlRead($lstData1)
        If $temp = "" Then
         $temp = GUICtrlRead($lstData2)
        EndIf
       $prev_edt = GUICtrlRead($edtNoteBox)
;~      _BOX($prev_edt & " " & $temp)
       GUICtrlSetData($edtNoteBox, $prev_edt & " " & $temp)
       _GUICtrlListBox_SetCurSel($lstData1, -1)
       _GUICtrlListBox_SetCurSel($lstData2, -1)
      Case 3
       $temp = GUICtrlRead($lstVid1)
        If $temp = "" Then
         $temp = GUICtrlRead($lstVid2)
        EndIf
       $prev_edt = GUICtrlRead($edtNoteBox)
;~      _BOX($prev_edt & " " & $temp)
       GUICtrlSetData($edtNoteBox, $prev_edt & " " & $temp)
       _GUICtrlListBox_SetCurSel($lstVid1, -1)
       _GUICtrlListBox_SetCurSel($lstVid2, -1)
      Case 4
       $temp = GUICtrlRead($lstEmail1)
        If $temp = "" Then
         $temp = GUICtrlRead($lstEmail2)
        EndIf
       $prev_edt = GUICtrlRead($edtNoteBox)
;~      _BOX($prev_edt & " " & $temp)
       GUICtrlSetData($edtNoteBox, $prev_edt & " " & $temp)
       _GUICtrlListBox_SetCurSel($lstEmail1, -1)
       _GUICtrlListBox_SetCurSel($lstEmail2, -1)
      Case 5
       $temp = GUICtrlRead($lstSec1)
        If $temp = "" Then
         $temp = GUICtrlRead($lstSec2)
        EndIf
       $prev_edt = GUICtrlRead($edtNoteBox)
;~      _BOX($prev_edt & " " & $temp)
       GUICtrlSetData($edtNoteBox, $prev_edt & " " & $temp)
       _GUICtrlListBox_SetCurSel($lstSec1, -1)
       _GUICtrlListBox_SetCurSel($lstSec2, -1)
     EndSwitch
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...