Classic Shell
http://www.classicshell.net/forum/

Differentiate Ctrl-Esc, Windows Key, Surface Touch Win Btn
http://www.classicshell.net/forum/viewtopic.php?f=13&t=2034
Page 1 of 1

Author:  Leif [ Tue Jan 21, 2014 10:16 am ]
Post subject:  Differentiate Ctrl-Esc, Windows Key, Surface Touch Win Btn

Hi,

Awesome utility! Thank you very much.

I'm running Windows 8.1 on a Surface Pro 2.

Is it possible to make ClassicShell actually tell the difference between:

1. Ctrl-Esc
2. WinKey
3. The Windows Logo touch key on the Surface Pro





Right now, all three are lumped together under the "Windows Key" label, making it impossible to select different actions.

I'm not sure yet whether it would make sense for Ctrl-Esc to open ClassicShell and the Windows Key to open the Start Screen, but I do know it makes no sense for the touch key to open the classic start menu!

Likely, the ideal configuration (for me, with the surface pro 2) would be:

Ctrl-Esc = Classic start menu
WinKey = Start Screen
Touch Key = Start Screen

Thanks again for a fantastic utility.

///Leif

Author:  Leif [ Tue Jan 21, 2014 10:58 am ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B

Just to add some information,
I'm not sure how ClassicShell is currently hooked into the start menu. It may be that it doesn't tell you which key actually resulted in the start menu being opened.

But, I just did some experiments myself, and if there is absolutely no other way to do it, GetAsyncKeyState will do the job.

You would need to have a timer running at all times, reading GetAsyncKeyState & 0x8000 of VK_LWIN.

By the time you get the "open start menu" call, if VK_LWIN was pressed within the last 300ms (for example), then the user pressed the Windows Key on the keyboard to open the start menu.

If GetAsyncKeyState(VK_CONTROL) & 0x8000 is true by the time you get the call, then the user pressed CTRL-ESC.

If NEITHER of the two above are true, and the start menu wasn't opened by the mouse (which you already know how to differentiate), then the user opened the start menu from the surface touch key.

I develop Win32 software for a living and have done so for 15 years, let me know if I can be of any assistance.

///Leif

Author:  Ivo [ Wed Jan 22, 2014 9:01 am ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B

There are already 7 ways to open the start menu. I am hesitant to add more at this time.

Author:  Leif [ Wed Jan 22, 2014 11:24 am ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B

Hi Ivo!

I don't mean to add more. I need the windows logo touch key on the surface pro to open the metro start screen as opposed to the start menu. When using the surface as a tablet, that's how you access the start screen.

I could live with Ctrl-Esc and the Windows Key both being treated the same (even if it's not ideal) but the touch key is kind of a dealbreaker, because the metro interface really is a good thing on a tablet.

Do you understand what I'm trying to do? If there is already a way to do it, please do let me know. I tried both the forum search and google and came up empty.


If Classic Shell has a plug-in API of some sort I'd be happy to write my own extension if you do feel that this request is too specialized, but I don't really see it as such, as anyone with a Surface Pro will have the same issue.

///Leif

Author:  Gaurav [ Wed Jan 22, 2014 11:35 am ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B

Having an option for the hardware key on tablets makes sense IMHO since it's a physical button - separate from a keyboard or mouse. Also, it could show in the Start Menu settings UI only if such a hardware button was detected (to avoid cluttering with more choices).

But as for Ctrl+Esc, it was there for keyboards without the Winkey. If you set Winkey to open Start screen, then just use Shift+Win instead of Ctrl+Esc to open Classic Start Menu.

Author:  Ivo [ Wed Jan 22, 2014 11:43 am ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B

Unfortunately I don't own a Windows tablet and can't do any testing.
I am almost sure the hardware button just simulates pressing Win on the keyboard. So GetKeyState may actually report that VK_LWIN is pressed.

Author:  Leif [ Wed Jan 22, 2014 12:25 pm ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B

Ivo wrote:
I am almost sure the hardware button just simulates pressing Win on the keyboard. So GetKeyState may actually report that VK_LWIN is pressed.


It doesn't, Ivo. I tested it to make sure, before I posted. Wouldn't want to request something impossible ;).

The low-order bit (of the GetAsyncKeyState VK_LWIN) gets set once, but the high order bit (0x8000) never gets set!
So, if you check whether that bit has been set within the last 300ms or so (which you can do with a timer), it will work.

You may still need to check VK_CTRL because if ctrl-esc is pressed to open the start menu, VK_LWIN will also not get set. That's why I suggested telling all three apart, because they kind of go together.
I'll be happy to beta test a solution for you of course ;).

GauravK, I may be oldschool but I always use ctrl-esc to open the start menu when I'm at the keyboard. It's deeply ingrained in muscle memory.

Author:  Gaurav [ Wed Jan 22, 2014 12:38 pm ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B

Leif wrote:
GauravK, I may be oldschool but I always use ctrl-esc to open the start menu when I'm at the keyboard. It's deeply ingrained in muscle memory.


You could use a simple AutoHotkey script for mapping Ctrl+Esc to Shift+Win or make Ctrl+Esc run "C:\Program Files\Classic Shell\ClassicStartMenu.exe" -open.

Edit: I made a quick AutoHotkey EXE script to open Classic Start Menu using Ctrl+Esc. If Classic Shell is installed on another partition or path which is different from the default, then edit the AHK script to correct the path and compile it again using AutoHotkey.

Attachments:
Open CSM with Ctrl+Esc.zip [213.96 KiB]
Downloaded 953 times

Author:  Leif [ Thu Jan 23, 2014 11:35 pm ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B

Thanks, GauravK! I will try it shortly.

Author:  Leif [ Wed Jan 29, 2014 9:55 pm ]
Post subject:  Re: Differentiate Ctrl-Esc, Windows Key, Surface Touch Win B  Topic is solved

Works perfectly! Thanks man. Now CSM is usable on the surface pro 2, without breaking metro for tablet use!

Best regards,
///Leif

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/