topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 9:40 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: ALT key problem  (Read 9456 times)

mikeyww

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
ALT key problem
« on: November 13, 2016, 08:23 AM »
ALT + number key launches programs if the left ALT key is used but not when the right ALT key is used.  Please enable for both!

Computer: TOSHIBA PORTEGE R930
Operating system: Microsoft Windows 7 Professional 64-bit Version 6.1.7601
Service pack: 1.0
Total physical memory (MB): 16262
Available physical memory (MB): 9994
Processor: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz 64-bit
Processor type: Intel64 Family 6 Model 58 Stepping 9
BIOS: TOSHIBA Default System BIOS Version 6.80 
Motherboard: TOSHIBA PORTEGE R930 Version A0
Dots per inch (DPI): 120

Mike

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ALT key problem
« Reply #1 on: November 13, 2016, 06:09 PM »
That's interesting.
I had not tried that before, having simply assumed that LeftAlt was different to RightAlt anyway (same with LeftShift/RightShift and LeftCtrl/RightCtrl being different), but I've just tried it and confirmed it for myself - LeftAlt is indeed different to RightAlt. This is on an HP Pavilion laptop, OS is Win10-64 Pro.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #2 on: November 13, 2016, 06:12 PM »
ALT + number key launches programs if the left ALT key is used but not when the right ALT key is used.  Please enable for both!

Computer: TOSHIBA PORTEGE R930
Operating system: Microsoft Windows 7 Professional 64-bit Version 6.1.7601
Service pack: 1.0
Total physical memory (MB): 16262
Available physical memory (MB): 9994
Processor: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz 64-bit
Processor type: Intel64 Family 6 Model 58 Stepping 9
BIOS: TOSHIBA Default System BIOS Version 6.80 
Motherboard: TOSHIBA PORTEGE R930 Version A0
Dots per inch (DPI): 120

Mike

My suggestion would be to add another short cut for launch, and use the alternate key.  Does that work?  If it does, then that would seem to be the correct way to code such a feature, as left and right are different, and some would only like to use one (Me) but not the other.

mikeyww

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #3 on: November 13, 2016, 06:41 PM »
Since the keyboard interface provides only one action for the ALT key, both ALT keys should work to perform the designated action.

ayryq

  • Supporting Member
  • Joined in 2009
  • **
  • Points: 101
  • Posts: 289
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #4 on: November 13, 2016, 08:24 PM »
Do you have something else using right alt? Many systems use it as a modifier for accented characters; I think windows may be able to use it for certain accessibility options as well. I run a utility (WinCompose) which captures right-alt (I use only left-alt for launching farr, and typically numpad for launching programs).

ayryq

  • Supporting Member
  • Joined in 2009
  • **
  • Points: 101
  • Posts: 289
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #5 on: November 13, 2016, 08:27 PM »
Also, this whole thread (and a couple others) got pushed to rss, one post at a time. Kind of weird.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #6 on: November 13, 2016, 08:33 PM »
Since the keyboard interface provides only one action for the ALT key, both ALT keys should work to perform the designated action.

right Alt (AltGr) often works the same as Ctrl+Alt (seems to be the other way round: https://en.wikipedia..._Alt_as_a_substitute although I have some older software where AltGr will work same as a Ctrl+Alt+ shortcut)

Some interesting related queries:
Can I make Ctrl+Alt NOT act like AltGr on Windows? (http://superuser.com...ike-altgr-on-windows)
How to globally map AltGr key to Alt key? (http://stackoverflow...altgr-key-to-alt-key)
Why does Alt Gr have the same keyCode as Ctrl? (http://stackoverflow...same-keycode-as-ctrl)
Tom

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #7 on: November 13, 2016, 09:29 PM »
Since the keyboard interface provides only one action for the ALT key, both ALT keys should work to perform the designated action.

Actually, that's incorrect.  They give different virtual keycodes, for the express means of using them differently. 

The Virtual Key Code for Alt is VK_MENU, but is extended into VK_RMENU, and VK_LMENU.

Try CTRL+ALT+DEL using the keys on the right side of the keyboard.  It doesn't work.  So this is more a function of implementation, than error.  And if the workaround works, it seems that it may be functioning as designed- that's mouser's call, though it will affect at least myself if he does change it.

The distinct Virtual KeyCodes from MSDN:

VK_MENU
0x12
ALT key
VK_LMENU
0xA4
Left MENU key
VK_RMENU
0xA5
Right MENU key

To Tom's excellent point, when you press right alt you get the following:
vkCode: 162, wparam: 260, lparam: 3398032
vkCode: 165, wparam: 260, lparam: 3398032

And when you release, you get the following:
vkCode: 162, wparam: 257, lparam: 3398032
vkCode: 165, wparam: 257, lparam: 3398032

It's sending two keys - the shortcut for CTRL+ALT.

AltGr+Del used to do the same as CTRL+ALT+DEL, but it's handled at a lower level than normal key combinations now.

mikeyww

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #8 on: November 14, 2016, 04:40 AM »
I haven't made myself clear.  The following screenshot shows that pressing ALT plus a number key should launch a program.

image5-20161114b.png

I would like this FARR feature to work with both ALT keys.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: ALT key problem
« Reply #9 on: November 14, 2016, 07:40 AM »
You are correct, I will make it so that either alt button works in launching items with that option.

mikeyww

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #10 on: November 14, 2016, 09:11 AM »
Thank you!

Mike

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #11 on: November 14, 2016, 10:44 AM »
I haven't made myself clear.
no,
it was clear what you wanted :)
On international keyboards at any rate, the 'right Alt' is 'AltGr' which is a different key. So saying they 'should' both work was maybe what prompted the responses. I find it an interesting topic anyway -- I was surprised (and happy) many years ago to find with some (graphics) software I was able to use AltGr+[whatever] instead of Ctrl+Alt+[whatever] shortcuts.
Tom

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #12 on: November 14, 2016, 10:49 AM »
I haven't made myself clear.
no,
it was clear what you wanted :)
On international keyboards at any rate, the 'right Alt' is 'AltGr' which is a different key. So saying they 'should' both work was maybe what prompted the responses. I find it an interesting topic anyway -- I was surprised (and happy) many years ago to find with some (graphics) software I was able to use AltGr+[whatever] instead of Ctrl+Alt+[whatever] shortcuts.


It wasn't clear to me :)  So I appreciated the clarification, and apologize for any confusion injected into the conversation.

mikeyww

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #13 on: November 14, 2016, 12:25 PM »
Thanks!

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ALT key problem
« Reply #14 on: November 14, 2016, 02:02 PM »
Because I didn't like to suggest to a FARR user that they could work around this overlooked key issue/problem for themselves, I refrained from mentioning it earlier, but it had occurred to me that one could use AHK (AutoHotkey) to capture and distinguish between LeftAlt and RightAlt keys at the time of key depression, and thereby trigger the requisite FARR functionality when the RightAlt key was depressed.

This would be a workaround that one could immediately implement, and would not necessitate a change in FARR. I mean, it seems a bit like overkill to have to program in a change to FARR just for one overlooked key. Nor would an AHK workaround be likely to be affected by any subsequent change in FARR, though of course one would need to be continually using AHK to make it work in the first place (and which is actually the sort of thing that AHK is useful for, anyway). Of course, not all FARR users will necessarily be (or want to be) AHK users as well.
Just a thought.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ALT key problem
« Reply #15 on: November 14, 2016, 02:13 PM »
@mouser: If you haven't thought of it already, might I suggest that, whilst you are looking in the code, it might be worth checking whether the same issue is present in Ctrl+something or other FARR hotkey combos? - i.e., do they work consistently where there is a possibility for a Left and Right version?
(This should not be construed as a political comment.)

mikeyww

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #16 on: November 15, 2016, 06:20 AM »
Good ideas.  I would say that the current approach represents a bug, because the user expects both ALT keys to work.  Fixing the bug would require either accommodating the expectation, or changing the instructional text to read something like, "Left ALT+#".

In the meantime, I have confirmed that the following works in AutoHotkey.

#IfWinActive Find and Run Robot
!1::Send !1
!2::Send !2
!3::Send !3
!4::Send !4
!5::Send !5
!6::Send !6
!7::Send !7
!8::Send !8
!9::Send !9
#IfWinActive ; end FARR block
« Last Edit: November 15, 2016, 06:30 AM by mikeyww »

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ALT key problem
« Reply #17 on: November 16, 2016, 04:32 PM »
@mikeyww: Yes, an AHK workaround should work just fine. Are you going to implement that, pending @mouser fixing the omitted key(s) issue?
I meant to ask you why you needed to use RightAlt specifically. Is it because you usually have your mouse in your left hand and so prefer to use your right hand for hotkeys?

If you do not require RightAlt key functionality for anything else, then another alternative could be to use Microsoft's Remapkey.exe (discussed elsewhere in the DC forum) to make the RHS Alt key operate as LeftAlt. You would thus "lose" the RightAlt key functionality from the keyboard, and be left with two LeftAlt keys (one at each end of the Space bar).
Might be worth considering, anyway.

mikeyww

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: ALT key problem
« Reply #18 on: November 16, 2016, 04:42 PM »
I am using the AHK workaround, so a second workaround is not needed.  I use RightAlt in conjunction with keys on the left side of the keyboard, because that combination improves typing speed.  I still recommend fixing the bug.

Mike