* post นี้ยกเลิก โปรดดูอีก post หนึ่ง **

* post นี้ยกเลิก โปรดดูอีก post หนึ่ง **

AutoHotKey setting กรณีสลับปุ่ม Windows กับ Alt

ปัญหาคืออยากใช้ปุ่ม alt+spacebar ในการสลับภาษาให้เหมือนๆ กันระหว่าง Windows กับ Mac

ซึ่งใน Windows พยายามใช้ AutoHotkey แปลงปุ่ม alt+spacebar เป็น alt-shift แล้ว แต่มันใช้กับ Microsoft Office ไม่ได้ ก็เลยใช้วิธีใหม่ ใช้ win+spacebar แทน โดยสลับปุ่ม win เป็น alt ด้วย SharpKeys เลย ได้ผลดี คือ ตอบสนองไว ใช้ได้ทุกโปรแกรม แต่ปัญหาที่ตามมาก็คือ ต้อง ปรับ short cut อื่นๆ ที่เคยใช้กับ alt ให้มาใช้กับ win ตามในข้อ 2

สรุปขั้นตอน
1. ใช้ SharpKeys สลับปุ่ม Alt กับ Windows (แก้ registry)

2. AutoHotKey setting for Windows

#q::Send, !{F4}
#a::Send, ^a
#c::Send, ^c
#v::Send, ^v
::Send, ^t
#x::Send, ^x
#w::Send, ^w
#z::Send, ^z
#y::Send, ^y

;#m::Send, +{#} ; minimize all
;#u::Send, +{#}m ; unminimize

!s:: Send, #s
!e:: Send, #e
!r:: Send, #r

!m:: WinMinimizeAll

LWin & Tab::AltTab
LWin & Left:: Send !{Left}
LWin & Right:: Send !{Right}

#f4::WinClose, A ; Win+C

#`:: ; Next window
WinGetClass, ActiveClass, A
WinGet, WinClassCount, Count, ahk_class %ActiveClass%
IF WinClassCount = 1
Return
Else
WinGet, List, List, % “ahk_class ” ActiveClass
Loop, % List
{
index := List – A_Index + 1
WinGet, State, MinMax, % “ahk_id ” List%index%
if (State -1)
{
WinID := List%index%
break
}
}
WinActivate, % “ahk_id ” WinID
return

#^`:: ; Last window
WinGetClass, ActiveClass, A
WinGet, WinClassCount, Count, ahk_class %ActiveClass%
IF WinClassCount = 1
Return
Else
WinGet, List, List, % “ahk_class ” ActiveClass
Loop, % List
{
index := List – A_Index + 1
WinGet, State, MinMax, % “ahk_id ” List%index%
if (State -1)
{
WinID := List%index%
break
}
}
WinActivate, % “ahk_id ” WinID
return