Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#333051 - 18/05/2010 09:34 Correct XP ALT key behaviour?
pca
old hand

Registered: 20/07/1999
Posts: 1102
Loc: UK
Hi.

I have an odd problem with a program under XP, and I was hoping one of the windows-experienced programmers here might have an opinion on it (I'm looking at you, Roger smile ).

Basically, I'm having trouble with the newest version of the PCB CAD package I use, Seetrax DesignerXL. I use a wacom graphics tablet for the thing, and when designing the PCB artwork, have cause to constantly use a couple of commands that can be accessed by keyboard shortcuts. The most common of these commands I have assigned to the soft buttons along the top edge of my Intuos 2 tablet, as keystroke sequences.

For example, to change the origin of the grid the artwork editor uses, you do ALT-G,E as two keystrokes, ie hold down ALT and press G, then release ALT, then press E. In the wacom tablet software you add a sequence like this by going to the correct menu and issuing the keyboard commands you want, and it records them. You can't have just the ALT key on it's own, for the fairly sensible reason that it's a keyboard modifier, not a key as such.

Unfortunately, in DesignerXL this sequence does nothing at all, although it works perfectly in the older version RangerXL. I reported it ages ago as a bug, and recently I was called by the tech support people at Seetrax and we went over the problem trying to nail down exactly what was actually happening, as both they and I were under the impression that it sometimes worked but something made it go away. (This is because in RangerXL you can indeed make keyboard shortcuts go away under rare, ill-defined circumstances)

We eventually discovered that in fact, it works, but in an odd manner. If instead of holding ALT down while pressing a menu key, you press ALT and release it, then press the appropriate menu key, and so on, it works quite happily. Sadly, as you can't assign the ALT key on it's own in the Wacom software, this is of no help wink

Further experimentation showed that most if not all windows programs will accept this method of using ALT, as well as the first method. For example, in Firefox if you go ALT, then F, you get the file menu, the same as if you go ALT-F. The funny thing is, no-one seems to realise this! Nobody I have talked to, people who have used windows for decades, knew that one could use ALT on it's own, they always used ALT + key rather than ALT, key.

Has this behaviour changed at some point? I'm nearly sure that XP didn't used to do this, but have no way of being sure or of proving it, short of installing an old version on a spare machine. The best theory I have heard so far was from a friend who suggested it might have been added by an update, to support touchscreens, where this sort of serial keyboard modifier might work better than a concurrent one. Or have we all just never even tried it for all these years because we just knew it wouldn't work, and were wrong?

I still maintain it's a bug in DesignerXL, by the way, because if normal Windows behaviour is to accept both methods, it should as well.

pca
_________________________
Experience is what you get just after it would have helped...

Top
#333052 - 18/05/2010 09:56 Re: Correct XP ALT key behaviour? [Re: pca]
andy
carpal tunnel

Registered: 10/06/1999
Posts: 5916
Loc: Wivenhoe, Essex, UK
As far as I remember that is the way Windows menus have always worked, in most apps at least.
_________________________
Remind me to change my signature to something more interesting someday

Top
#333053 - 18/05/2010 10:02 Re: Correct XP ALT key behaviour? [Re: andy]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4180
Loc: Cambridge, England
I don't think it was in Windows 3.11, but it was added a long time ago. Possibly Windows 95 long ago. It's for accessibility: for people who can only reliably press one key at a time.

Peter

Top
#333054 - 18/05/2010 10:10 Re: Correct XP ALT key behaviour? [Re: pca]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I believe that in the standard Windows widgets that if you press alt on its own, it highlights the menu bar, and allows you to use "regular" keys to access those menu items. I'm pretty sure it's been this way since at least Windows 3.1. It used to be that the key to press was always underlined in the menu bar. Under more recent versions of Windows, it underlines the character only after you press the Alt key.

As far as I know, this is completely separate from defined accelerators, which may exist for menus as well as for individual menu items. I may be wrong and the default is to set up both methods for menus. Assuming I'm not wrong, though, I can see where they might have defined one and not the other. I'm sure that a Windows developer would be more readily able to answer that.

That said, though, the fact that your tablet is unable to press Alt on its own means that it is not linking into the input stack at a low enough level. Any key you press generates a KeyDown event and a KeyUp event, including Alt, Control, etc. Later in the stack, the OS reinterprets those events into new events like Alt-G, Ctrl-C, etc. If your driver cannot send an Alt-KeyDown event, that's the fault of the driver; it's certainly possible. Maybe you can find a different macro application to stack on top of it.
_________________________
Bitt Faulk

Top
#333056 - 18/05/2010 10:22 Re: Correct XP ALT key behaviour? [Re: peter]
andy
carpal tunnel

Registered: 10/06/1999
Posts: 5916
Loc: Wivenhoe, Essex, UK
I've just booted Windows 3.11 in VMWare, the alt key worked exactly the same back then wink
_________________________
Remind me to change my signature to something more interesting someday

Top
#333057 - 18/05/2010 11:07 Re: Correct XP ALT key behaviour? [Re: andy]
pca
old hand

Registered: 20/07/1999
Posts: 1102
Loc: UK
OK, thanks guys. It looks like this is behaviour that I, and quite a few others, have simply never noticed before!

Oh well, live and learn. I still say the program in question should do the same thing as other windows programs, though...

I'll have to hunt around and see if I can find something to add macros as you suggest, Bitt.

pca
_________________________
Experience is what you get just after it would have helped...

Top
#333063 - 18/05/2010 15:12 Re: Correct XP ALT key behaviour? [Re: pca]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I know for a fact that AutoIt is able to send ALTDOWN/ALTUP events, but it's not really designed as a TSR-type application, though I think you could probably do it with its HotKeySet function. Regardless, I'm sure there's something out there more appropriate to your situation.
_________________________
Bitt Faulk

Top
#333064 - 18/05/2010 15:15 Re: Correct XP ALT key behaviour? [Re: wfaulk]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Regardless, if you want to use AutoIt, this script should work:
Code:
$the_end_of_time = False

HotKeySet("!+^G", "DoMacro")
Do
	Sleep(120000)
Until ($the_end_of_time)

Func DoMacro()
	Send("{CTRLUP}{SHIFTUP}{ALTUP}{LALT}ge")
EndFunc

The "{CTRLUP}{SHIFTUP}{ALTUP}" at the beginning of the stuff to send is to clear the keys you might be holding down to activate the macro.
_________________________
Bitt Faulk

Top
#333065 - 18/05/2010 15:42 Re: Correct XP ALT key behaviour? [Re: wfaulk]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Bitt is correct in that the ALT and release behavior is separate from real keystroke shortcuts or accelerators. It's a way to navigate the menu with the keyboard, while real shortcuts are single press actions that immediately fire and may or may not be linked with a specific menu command.

Instead of jumping through these hoops, get I think the best idea is to get back to the authors of this program and get them to put in some real keyboard shortcuts for the various options you want. If they're really keen on adding functionality for you ask them to allow editing of their shortcuts so that you can define or redefine your own shortcuts for any menu item. That way you can have sensible single press shortcuts as well, not something you have to stack up in a macro only to trigger a single function.

If their program currently doesn't work without releasing alt for any keyboard shortcut, then they indeed have a significant bug.



Edited by hybrid8 (18/05/2010 15:43)
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#333066 - 18/05/2010 16:00 Re: Correct XP ALT key behaviour? [Re: hybrid8]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Agreed. I didn't mean to imply that you shouldn't bug them to fix their bug.
_________________________
Bitt Faulk

Top
#333070 - 18/05/2010 16:34 Re: Correct XP ALT key behaviour? [Re: pca]
Tim
veteran

Registered: 25/04/2000
Posts: 1525
Loc: Arizona
Originally Posted By: pca
Has this behaviour changed at some point? I'm nearly sure that XP didn't used to do this, but have no way of being sure or of proving it, short of installing an old version on a spare machine. The best theory I have heard so far was from a friend who suggested it might have been added by an update, to support touchscreens, where this sort of serial keyboard modifier might work better than a concurrent one. Or have we all just never even tried it for all these years because we just knew it wouldn't work, and were wrong?

I've used ALT to access menus since using EDIT way back in the DOS 6.22 days (ALT - enter - up arrow - enter - enter to save and quit I think it was). It has always been there. A lot of times I use that rather than the shortcut key simply because it is easier to remember than some of the more rare combinations.

Top
#333113 - 19/05/2010 15:42 Re: Correct XP ALT key behaviour? [Re: pca]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: pca
Oh well, live and learn. I still say the program in question should do the same thing as other windows programs, though...


Probably. Does it have another keystroke (not a modifier, so that you can program it into the tablet) that you can use to access the menu? F10 used to work on IBM CUI-compliant apps (and still works in Notepad in Win7).
_________________________
-- roger

Top