A modification of the workaround from the previous post:
As I'm using OneNote on a tablet, often without a keyboard, I wanted to eliminate the need to press F12, having instead the ribbon tabs shown just after touching the usual FullScreen button in the program. This is done by the following AHK script (see the comments
within):
; OneNote: show ribbon tabs when clicking fullscreen button.
; Needs the command "Hide the ribbon" to be set as
; the first item in the Quick Access Toolbar.
; The specific numerical button boundaries are valid for the standard screen of ATIV-500.
; They should be changed to the appropriate values on other screens.
#IfWinActive, ahk_class Framework::CFrame
LButton::
MouseGetPos, x, y
if (x > 1080 and x < 1125 and y > 156 and y < 200)
{
send {F11}
send !1
}
else
Send, {LButton}
return
#IfWinActive
To find the button boundaries on another screen one may use the following script to get the coordinates of the button corners:
#IfWinActive, ahk_class Framework::CFrame
LButton::
MouseGetPos, x, y
Msgbox, %x% %y%
return
#IfWinActive
Thanks Dmitry_975, I added some code to your work for Microsoft Surface pro 3.
So now it also check if the Surface is in landscape or portraite mode (using one note 2013 in touch mode):
; OneNote: show ribbon tabs when clicking fullscreen button.
; Needs the command "Hide the ribbon" to be set as
; the first item in the Quick Access Toolbar.
; The specific numerical button boundaries are valid for the standard screen of ATIV-500.
; They should be changed to the appropriate values on other screens.
#IfWinActive, ahk_class Framework::CFrame
LButton::
MouseGetPos, x, y
if (A_ScreenWidth = 2160)
{
if (x > 1763 and x < 1840 and y > 289 and y < 361)
{
send {F11}
send !1
}
else
Send, {LButton}
return
}
if (A_ScreenWidth = 1440)
{
if (x > 1043 and x < 1120 and y > 290 and y < 365)
{
send {F11}
send !1
}
else
Send, {LButton}
return
}
#IfWinActive