2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AHK(AutoHotkey)を使い Menuを作成する 【F12】でメニューを表示(マウスでも選択可能)「無変換キー」をIME ON、OFFの切り替えに変更

Last updated at Posted at 2019-10-18

;===============================================
Menu , kuhen , Add , (&F12) [ F12 ] Ver.2019-10-19 By SKojima@kuhen.jp,F12_
Menu , kuhen , Add ;
Menu , kuhen , Add , (&F12) [ F12 ] 【Clipboardクリア】 Ver.2019-10-19,F12_
Menu , kuhen , Add , (&F12) [ F12 ] 【自分メモ】ここに何か書いておく 例:WiFiのPWとか, F12_
Menu , kuhen , Add ;
Menu , kuhen , Add , (&!6) [ Alt+ 6 ] 【 HPを開く 】https://kuhen.jp/ndb/ , ALT_6
Menu , kuhen , Add ;
Menu , kuhen , Add , (&!/) [ Alt+ / ] 【デスクトップのtodayフォルダ】を開く, ALT_/
Menu , kuhen , Add , (&!t) [ Alt+ T ] 【todayフォルダ】にタイムスタンプフォルダ自動作成, ALT_T
Menu , kuhen , Add ;
Menu , kuhen , Add , (&!c) [ Alt+ C ] 【Win10で画面キャプチャ】Win+Shift+S, ALT_C
Menu , kuhen , Add ;
return
;===============================================

;--------------------------------------------------
;無変換をIME ON、OFFの切り替えに変更
;【ご注意】Menuの後にこれを書くこと
;--------------------------------------------------
vk1D::Send,{sc029}
;--------------------------------------------------

;--------------------------------------------------
F12:: ; F12 【メニュー表示】&【Clipboardクリア】
;--------------------------------------------------

F12_:

Clipboard =
Menu , kuhen , show ; , 10 , 10
return
;--------------------------------------------------

;--------------------------------------------------
!6:: ; Alt+6 ;HPを開く
;--------------------------------------------------

ALT_6:

IMEGetstateOFF()
Sleep,300

Run,https://kuhen.jp/ndb/
Sleep,300

IMEGetstateON()

Return
;--------------------------------------------------

;--------------------------------------------------
!/:: ; Alt+/
;--------------------------------------------------

ALT_/:

Run , %A_Desktop%\today

Return
;--------------------------------------------------

;--------------------------------------------------
!t:: ; Alt+t
;--------------------------------------------------

ALT_T:

IMEGetstateOFF()
Sleep,300

todayvar = %A_Now%

StringMid , yvar , todayvar , 1 , 4

StringMid , mvar , todayvar , 5 , 2

StringMid , dvar , todayvar , 7 , 2

StringMid , hmvar , todayvar , 9 ,4

cfn = %yvar%-%mvar%-%dvar%_%hmvar%

cfn = %A_Desktop%\today%cfn%

;MsgBox , Today【フォルダ作成】%cfn%

FileCreateDir, %cfn%
run , %cfn%

IMEGetstateON()
Sleep,300

Return
;--------------------------------------------------

;--------------------------------------------------
!c:: ; Alt+c ; Win10用画面キャプチャー Shift + Win + S
;--------------------------------------------------

ALT_C:

Sleep,300

Send , +#s

Return
;--------------------------------------------------

;===============================================================================
;【IMEのON、OFFに参考にさせてもらったサイト】
;https://qiita.com/neokix/items/83ac2ac8e1dd405528b0
IMEGetstateOFF(){
DetectHiddenWindows, ON
WinGet, vcurrentwindow, ID, A
vgetdefault := DllCall("imm32.dll\ImmGetDefaultIMEWnd", "Uint", vcurrentwindow)
vimestate := DllCall("user32.dll\SendMessageA", "UInt", vgetdefault, "UInt", 0x0283, "Int", 0x0005, "Int", 0)
DetectHiddenWindows, Off

If (vimestate=0) ;imeがoffなら
{
;Offだから何もしない
}
else
{
Send, {vkf3}
}

return

}
;===============================================================================

;===============================================================================
;【IMEのON、OFFに参考にさせてもらったサイト】
;https://qiita.com/neokix/items/83ac2ac8e1dd405528b0
IMEGetstateON(){
DetectHiddenWindows, ON
WinGet, vcurrentwindow, ID, A
vgetdefault := DllCall("imm32.dll\ImmGetDefaultIMEWnd", "Uint", vcurrentwindow)
vimestate := DllCall("user32.dll\SendMessageA", "UInt", vgetdefault, "UInt", 0x0283, "Int", 0x0005, "Int", 0)
DetectHiddenWindows, Off

If (vimestate=0) ;imeがoffなら
{
Send, {vkf3}
}
else
{
;Onだから何もしない
}

return

}

;===============================================================================

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?