Alt Key Error fix MBWin7Fix.tpl template

Searching the NG is a pain. Here is the template from that thread in case anyone needs it. Is it true this is happening again in C10?

#!----------------------------------------------------------------------------------------------------
#!
#!
#! Author: Marius van den Berg
#!
#! Fixes the bug where the alt button hangs an application
#! If a window is open in an application in windows 7, the app will freeze up if the user presses alt
#! to access the file menu
#!
#! The problem occurs if the ALt/F10 was only pressed without any hot keys
#! So basically all the template does is, if only ALT was pressed when any windows
#! in the app are open I capture the KeyCode - event and do nothing
#!
#! If no windows are open however, the app will call the menupress manually.
#!
#!
#!----------------------------------------------------------------------------------------------------
#Template(MBWin7Fix,'Marius van den Berg Templates'),FAMILY('CW20'),Family('ABC')
#Extension(MBWin7Fix,'Marius van den Berg Windows 7 Fix'),APPLICATION
#!----------------------------------------------------------------------------------------------------
#!#ATSTART
#! #CALL(%ReadABCFiles(ABC))
#!#ENDAT
#!#!----------------------------------------------------------------------------------------------------
#Sheet
#Display('Marius van den Berg Windows 7 Alt Button Fix')
#EndSheet
#!----------------------------------------------------------------------------------------------------
#! Set the altkey as an alertkey
#!#At(%DataSection,'Win7Fix')
#!WF7:Flag Byte
#!#EndAt
#!#AT(%AfterWindowOpening)
#! #If(%WindowStateMent<>'')
#! #If(%MenuBarStateMent='')
#! ! Set the Tab Key And F10 Key as Alert Keys MBWin7Fix
#! %Window{Prop:Alrt,254}=1024
#! %Window{Prop:Alrt,255}=F10Key
#! #EndIf
#! #EndIf
#!#ENDAT
#!#AT (%WindowEventHandling, 'AlertKey')
#! #If(%WindowStateMent<>'')
#! #If(%MenuBarStateMent='')
#! ! Only select the menu if no window was open MBWin7Fix
#! If KeyCode() = 1024 ! If Tab was Pressed
#! If Thread() = 1 Then
#! PressKey(F10Key)
#! End
#! End
#! If KeyCode() = F10Key ! If F10 was Pressed
#! If Thread() = 1 Then
#! PressKey(ALTF)
#! End
#! End
#! #EndIf
#! #EndIf
#!#ENDAT

#AT(%AfterWindowOpening)
#If(%WindowStateMent<>'')
if windowsversion()>5
%Window{Prop:Alrt,254}=1024 ! Set the Alt Key as Alert Keys MBWin7Fix; na ovaj naèin alt neæe raditi
end
#ENDIF
#ENDAT 

Also, looks like this could do with some work. Perhaps someone has an updated version around?

1 Like

Something similar is happening to me, but in the Clarion GUI. Annoying!

Yes it happening again. I did update the template a bit. I can post an update tomorrow.

Bertus

1 Like

https://github.com/BertusV/Clarion-Templates-Public Have a look at this and let me know how you go with it.

This was discussed on ClarionLive just yesterday and they posted some code.

The ALT KEY LOCKUP bug is back, and shows itself with the latest version of Windows 10! We have two solutions:
Bruce wrote a template during the ClarionLive Open Webinar. This needs to be applied to every app in your solution, and is a good example of how to add code to every window using a template: Download UltimateWindowExample
Carl Barnes wrote a solution for this, and it was published in ClarionMag. Dave Harms has given permission for everyone to use it!! Thanks Dave!!! This is added to your AppFrame only: Download CBAltWin7Fix
http://clarionlive.wikispaces.com/

I have put it into a gist as well. Now we have loads of copies spread around :smiley: