Skip to content

Instantly share code, notes, and snippets.

@rutan
Created November 20, 2017 18:21
Show Gist options
  • Save rutan/998a7fb47c97b3d7ce7b0c85952683ee to your computer and use it in GitHub Desktop.
Save rutan/998a7fb47c97b3d7ce7b0c85952683ee to your computer and use it in GitHub Desktop.
# 音量変更スクリプトさんのアドオン形式: フルスクリーンメニュー
module HZM_VXA
module AudioVol
class Window_VolConfig < Window_Command
#-------------------------------------------------------------------------
# ● コマンド生成:アクション
#-------------------------------------------------------------------------
alias hzm_vxa_volume_addon_fullscreen_make_command_list_actions make_command_list_actions
def make_command_list_actions
hzm_vxa_volume_addon_fullscreen_make_command_list_actions
add_command('フルスクリーン', :fullscreen)
end
#--------------------------------------------------------------------------
# ● 決定ボタンが押されたときの処理
#--------------------------------------------------------------------------
alias hzm_vxa_volume_addon_fullscreen_process_ok process_ok
def process_ok
if current_symbol == :fullscreen
process_addon_fullscreen
else
hzm_vxa_volume_addon_fullscreen_process_ok
end
end
#-------------------------------------------------------------------------
# ● フルスクリーンの実行
#-------------------------------------------------------------------------
def process_addon_fullscreen
api = Win32API.new('user32.dll', 'keybd_event', %w(i i i i), 'v')
sleep(0.2)
api.call(18, 0, 0, 0)
sleep(0.1)
api.call(13, 0, 0, 0)
sleep(0.1)
api.call(13, 0, 2, 0)
sleep(0.1)
api.call(18, 0, 2, 0)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment