Skip to content

Instantly share code, notes, and snippets.

@ishidur
Last active September 11, 2018 05:27
Show Gist options
  • Select an option

  • Save ishidur/0f73dc9fa8a5305e2f62c6dcecda169c to your computer and use it in GitHub Desktop.

Select an option

Save ishidur/0f73dc9fa8a5305e2f62c6dcecda169c to your computer and use it in GitHub Desktop.
Windowsのキーマップについて #settings #windows

Windowsのキーマップについて

CtrlとCapsLockを入れ替える

remapkey.exeを使いレジストリを入れ替える

  • remapkey.exeはWindows Server 2003 Resource Kit Toolsに含まれるソフトウェア
  • 管理者権限にて起動する必要がある
  • AutoHotKeyでは入れ替えがうまく出来ない
  • You can get Windows Server 2003 Resource Kit Tools from here

AutoHotKeyについて

ボリュームキーをスクロールに対応させる

ボリュームダイヤルがついたキーボードにおすすめ

Volume_Up::WheelUp
Volume_Down::WheelDown
Shift & Volume_Up::WheelLeft
Shift & Volume_Down::WheelRight

MSOffice2016でマウスによる水平スクロールを有効にする

Shift+マウスホイールでシートを水平にスクロールさせる

; powerpoint horizontal scroll
#IfWinActive ahk_exe POWERPNT.EXE
	~Shift & WheelUp::ComObjActive("PowerPoint.Application").ActiveWindow.SmallScroll(0,0,0,3)
	~Shift & WheelDown::ComObjActive("PowerPoint.Application").ActiveWindow.SmallScroll(0,0,3,0)
#IfWinActive

; word horizontal scroll
#IfWinActive ahk_exe WINWORD.EXE
	~Shift & WheelUp::ComObjActive("Word.Application").ActiveWindow.SmallScroll(0,0,0,3)
	~Shift & WheelDown::ComObjActive("Word.Application").ActiveWindow.SmallScroll(0,0,3,0)
#IfWinActive

; excel horizontal scroll
#IfWinActive ahk_exe EXCEL.EXE
	~Shift & WheelUp:: ; Scroll left.
	SetScrollLockState, On 
	SendInput {Left} 
	SetScrollLockState, Off 
	Return
	~Shift & WheelDown:: ; Scroll right.
	SetScrollLockState, On 
	SendInput {Right} 
	SetScrollLockState, Off
	Return
#IfWinActive

マウスをキーボードで操作する

  • Menu Key + w,a,s,dでマウスを↑,←,↓,→に移動
  • Menu Key + q,eで左クリック,右クリック
; Mouse manipulation with keyboard
AppsKey & q::
	Send,{LButton down}
	KeyWait,u
	Send,{LButton up}
	Return
AppsKey & e::MouseClick,right
AppsKey & w::
AppsKey & a::
AppsKey & s::
AppsKey & d::

While (GetKeyState("AppsKey", "P"))
{
	if While (GetKeyState("Shift", "P"))
	{
		; precision mode
		MoveX := 0, MoveY := 0
		SlowStep := 10
		MoveY += GetKeyState("w", "P") ? -SlowStep : 0
		MoveX += GetKeyState("a", "P") ? -SlowStep : 0
		MoveY += GetKeyState("s", "P") ? SlowStep : 0
		MoveX += GetKeyState("d", "P") ? SlowStep : 0
		MouseMove,%MoveX%,%MoveY%,0,R ;0(fastest)-100(slowest)
		Sleep,1
	}
	else{
		; usual
		MoveX := 0, MoveY := 0
		FastStep := 70
		MoveY += GetKeyState("w", "P") ? -FastStep : 0
		MoveX += GetKeyState("a", "P") ? -FastStep : 0
		MoveY += GetKeyState("s", "P") ? FastStep : 0
		MoveX += GetKeyState("d", "P") ? FastStep : 0
		MouseMove,%MoveX%,%MoveY%,0,R ;0(fastest)-100(slowest)
		Sleep,1
	}
	Return
}
Return

About Script

  • Names: Variable and function names are not case sensitive (for example, CurrentDate is the same as currentdate). For details such as maximum length and usable characters, see Names.
  • No typed variables: Variables have no explicitly defined type; instead, a value of any type can be stored in any variable (excluding built-in variables). Numbers may be automatically converted to strings (text) and vice versa, depending on the situation.
  • Declarations are optional: Except where noted on the functions page, variables do not need to be declared; they come into existence simply by using them (and each variable starts off empty/blank).
  • Spaces are mostly ignored: Indentation (leading space) is important for writing readable code, but is not required by the program and is generally ignored. Spaces and tabs are generally ignored at the end of a line, within an expression (except between quotes), and before and after command parameters. However, spaces are significant in some cases, including:
    • Function and method calls require there to be no space between the function/method name and (.
    • Spaces are required when performing concatenation.
    • Spaces may be required between two operators, to remove ambiguity.
    • Single-line comments require a leading space if they are not at the start of the line.
  • Line breaks are meaningful: Line breaks generally act as a statement separator, terminating the previous command or expression. (A statement is simply the smallest standalone element of the language that expresses some action to be carried out.) The exception to this is line continuation (see below).
  • Line continuation: Long lines can be divided up into a collection of smaller ones to improve readability and maintainability. This is achieved by preprocessing, so is not part of the language as such. There are two methods:
    1. Line continuation, where lines that begin with an expression operator (except ++ and --) are merged with the previous line. Lines are merged regardless of whether the line actually contains an expression.
    2. Continuation sections, where multiple lines are merged with the line above the section. The start and end of a continuation section are marked with ( and ) (both symbols must appear at the beginning of a line, excluding whitespace).
@ishidur

ishidur commented Sep 7, 2018

Copy link
Copy Markdown
Author

MS Office 2016 : Shift+マウスホイールで水平スクロールを〜
http://whoraibo.hatenablog.com/entry/2018/01/22/214852

@ishidur

ishidur commented Sep 7, 2018

Copy link
Copy Markdown
Author

@ishidur

ishidur commented Sep 7, 2018

Copy link
Copy Markdown
Author

List of Keys (Keyboard, Mouse and Joystick)
https://autohotkey.com/docs/KeyList.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment