I found a way to add hotkeys to the phpMyEdit page buttons. In the phpMyEdit.class.php section, there is an htmSubmit function, which places the labels on the buttons. I added:
If ($label=="Add") {
$label1 = 'Add" AccessKey="a';
} else {
$label1 = $label;
}
The single and double quotes must be exactly as listed above for this process to work. A few lines later in this file, I change the line:
.'" value="'.(isset($this->labels[$label]) ? $this->labels[$label] : $label);
to:
.'" value="'.(isset($this->labels[$label1]) ? $this->labels[$label1] : $label1);
With these two changes, I can use hotkey ALT+A to open the Add page. The resulting web page code looks like this:
<input type="submit" class="pme-add" name="PME_sys_operation" value="Add" AccessKey="a" />
Additional Details: Repeating the lines I used to add the Add button hotkey, I used this process to add hotkeys to ten of the buttons I use. I could not add hotkeys to the Copy and Delete buttons. I also could not add any html, underscores, brackets, or any other special coding or characters to the button names to indicate to users what the hotkey letters are; if I did, the buttons stopped working. I added a link to a web page named hotkeys that lists the hotkeys for the buttons, most but not all of which use the first letter of the word on the button. On some buttons, I changed the capitalization (e.g., Apply to applY, where Y is the hotkey). On other buttons, the button stopped working if I did not capitalize the first letter of the word. For hotkey clarity, I switched the navigation buttons to be named First, Prev, Next, and Last (with hotkeys F, P, N, and L, respectively). Previous did not work; I had to name it Prev. Open to suggestions on improving this coding. Thanks.
|