International Menus Help
Name: | International Menus |
Version: | 1.0 |
Last update: | 2019-02-18 17:51:22 |
This package defines default menu shortcuts for non-U.S. keyboards.
Introduction
By default, Alpha assumes that your keyboard layout is U.S.. If you are
using a different keyboard layout some default keyboard shortcuts for
various menu commands need to be adjusted. For example, when using a U.S.
keyboard Command-/ (⌘/
) is mapped to Open Windows ↣ Zoom. When using a Swiss keyboard, "/" is
Shift-7 so ⌘/
is meaningless and won't invoke the
desired command.
This International Menus feature (which is always turned on and can never
be turned off) will automatically adjust some of these problematic
shortcuts to use those tailored for the current keyboard layout. For
instance, in the previous example, the menu shortcut for the Open Windows ↣ Zoom menu item will be replaced by ⌘-
(command and dash) instead of ⌘/
(command and slash) if you declare a Swiss keyboard. Other menu items
will have their shortcut adapted similarly (see below).
Select Alpha ↣ Preferences ↣ Global Prefs ↣ International to adjust
your Keyboard preference, letting Alpha know which keyboard layout
you're using.
Click here to open the International Preferences panel.
In a future version, Alpha will hopefully be able to get the default
value for this preference directly from the OS.
Which menu items are affected?
The International Menus feature changes the following items:
Text ↣ Shift Left |
Text ↣ Shift Left Space |
Text ↣ Shift Right |
Text ↣ Shift Right Space |
Text ↣ Twiddle |
Text ↣ Twiddle Words |
Search ↣ Return to Bookmark |
Search ↣ Go To ↣ Go To Line… |
Search ↣ The Pin ↣ Hilite To Pin |
Window ↣ Zoom |
Window ↣ Choose A Window… |
Shrink Window ↣ Default |
Depending on which keyboard layout you use, some of the shortcuts for
these commands may not be changed, or no shortcuts may be defined for the
command. You can always assign your own personalized shortcuts to these
(and to any other commands) by selecting
Alpha ↣ Global Setup ↣ Keyboard Shortcuts ↣ Menu Shortcuts.
Click here to open the Menu-Shortcuts Preferences panel
User-defined shortcuts will always take precedence over those that are
defined by this feature.
Teaching Alpha new keyboard layouts
This is an advanced topic, and it might not be of much help if you're new
to either Tcl or AlphaTcl. This section assumes that you have read the Help
file section Changing Alpha's behavior.
If you're not using a western keyboard or if you encounter any problems,
reading the following section might help to clarify things and could help
you to fix the problem.
To define a new keyboard layout, add a line like this to your prefs.tcl
file:
set "keyboards(U.S.)" [list \
{§1234567890-=[];'\`,./} \
{±!@#$%^&*()_+{}:"|~<>?} \
[list s '\['] \
[list s '\]'] \
]
The first two lines tell Alpha how to map using the Shift key. Shift
maps each item in the upper string into the corresponding item in the
lower string.
The third and fourth lines define the keyboard shortcuts for the left and
right braces, in this example to Shift-[ and Shift-].
See the file alphaDefinitions.tcl for examples of keyboard layout
definitions, and the source for this package (internationalMenus.tcl)
for more examples.
If you define an array entry keyboards(my-country)
, then you can just
select that in the international prefs dialog, and Alpha will set the
flags correctly. You can then send that keyboard array entry to the
AlphaTcl-Users mailing list for inclusion in a future version of Alpha.
If a package wishes to be told when the keyboard changes, it can do that
by registering with the removekeyboard or keyboard hooks like this:
# tell me when we switch to a "Swiss German" keyboard
hook::register keyboard keys::swiss "Swiss German"
# tell me when we disable a keyboard
hook::register removekeyboard my_disable_proc
# tell me when we enable a keyboard
hook::register keyboard my_enable_proc
In this way a clever package could remove the need for restarting Alpha
by unbinding and then rebinding all necessary items.
If you need help defining a new keyboard layout, send a question to one
of the mailing lists described in the Readme file.
Known problems
Please report any problem or bug you encounter to
Alpha's Bug Tracker.
License and Disclaimer
Copyright (c) 1998-2019, the Alpha Community.
All rights reserved.
The International Menus package is free software and distributed under
the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the Alpha Community nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ALPHA COMMUNITY BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.