SMF Support > SMF 2.0.x Support

Changing shortcut Alt+s


How can I change default shortcut Alt+s into Alt+w ?
In Polish language we have letter ś and users on Mac OS can type it, because this shortcut works on both Alt buttons, and it sends message :|


I see somebody has this same problem. On my forum smf 2.0.2 users also reports this problem. Anybody has any idea how to solve it?

Note that if you're using Firefox, it's shift+alt+s.

Unfortunately, the keys used are hard coded into the HTML templates. Look through your Themes/<theme name>/ files for accesskey="s" and change it to something else. You might do it for all languages you support, or just Polish. Also remember to change $txt['shortcuts'] and $txt['shortcuts_firefox'] to show the new letter. It appears that only 'p' and 's' are in use by SMF, but many browsers define the use of other letters (including alt+w) for their own purposes, so make changes with caution, to minimize user confusion.

Thank you for helping ;)

I found it in few files, and it seems to work, but in editor.js is this code:

--- Code: ---// Register default keyboard shortcuts.
smc_Editor.prototype.registerDefaultShortcuts = function()
if (is_ff)
this.registerShortcut('b', 'ctrl', 'b');
this.registerShortcut('u', 'ctrl', 'u');
this.registerShortcut('i', 'ctrl', 'i');
this.registerShortcut('p', 'alt', 'preview');
this.registerShortcut('s', 'alt', 'submit');
--- End code ---

And should  I change also this.registerShortcut('s', 'alt', 'submit'); to this.registerShortcut('w', 'alt', 'submit'); ?

AFAIK none of browsers uses Alt+w. There is Ctrl+w for close tab/window, but I think that browsers don't use Alt+w :)

Yes, you'd have to change that, too. Some browsers running on Windows do use alt+w, so you should be aware of that (you would end up overriding that functionality).


[0] Message Index

Go to full version