Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative Shift+Arrow hotkeys to move window around by 10px #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions LayerX/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,17 @@ extension AppDelegate {
return
}

let offset = menuItem.isAlternate ? 10 : 1

switch arrow {
case .up:
window.moveBy(CGPoint(x: 0, y: 1))
window.moveBy(CGPoint(x: 0, y: offset))
case .left:
window.moveBy(CGPoint(x: -1, y: 0))
window.moveBy(CGPoint(x: -offset, y: 0))
case .right:
window.moveBy(CGPoint(x: 1, y: 0))
window.moveBy(CGPoint(x: offset, y: 0))
case .down:
window.moveBy(CGPoint(x: 0, y: -1))
window.moveBy(CGPoint(x: 0, y: -offset))
}
}

Expand Down
24 changes: 24 additions & 0 deletions LayerX/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,48 @@
<action selector="moveAround:" target="Voe-Tx-rLC" id="qks-64-WYp"/>
</connections>
</menuItem>
<menuItem title="Move up 10px" tag="20" alternate="YES" keyEquivalent="" id="Zz2-NY-etK">
<modifierMask key="keyEquivalentModifierMask" shift="YES"/>
<connections>
<action selector="moveAround:" target="Voe-Tx-rLC" id="VjL-oF-pX5"/>
</connections>
</menuItem>
<menuItem title="Move left 1px" tag="21" keyEquivalent="" id="Ud7-FA-vtA">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="moveAround:" target="Voe-Tx-rLC" id="RxY-3b-ZPJ"/>
</connections>
</menuItem>
<menuItem title="Move left 10px" tag="21" alternate="YES" keyEquivalent="" id="DDn-Bf-B7u">
<modifierMask key="keyEquivalentModifierMask" shift="YES"/>
<connections>
<action selector="moveAround:" target="Voe-Tx-rLC" id="Co3-jl-a9D"/>
</connections>
</menuItem>
<menuItem title="Move right 1px" tag="22" keyEquivalent="" id="SC9-Za-3te">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="moveAround:" target="Voe-Tx-rLC" id="7UQ-dw-xVi"/>
</connections>
</menuItem>
<menuItem title="Move right 10px" tag="22" alternate="YES" keyEquivalent="" id="nfz-Lb-qzf">
<modifierMask key="keyEquivalentModifierMask" shift="YES"/>
<connections>
<action selector="moveAround:" target="Voe-Tx-rLC" id="e7b-y6-itz"/>
</connections>
</menuItem>
<menuItem title="Move down 1px" tag="23" keyEquivalent="" id="T88-KV-33B">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="moveAround:" target="Voe-Tx-rLC" id="gZw-Fh-AIF"/>
</connections>
</menuItem>
<menuItem title="Move down 10px" tag="23" alternate="YES" keyEquivalent="" id="jnW-ch-rkY">
<modifierMask key="keyEquivalentModifierMask" shift="YES"/>
<connections>
<action selector="moveAround:" target="Voe-Tx-rLC" id="fPK-u8-6JB"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="Uol-cd-eOj"/>
<menuItem title="Increase Transparency" keyEquivalent="j" id="PLz-nj-Geg">
<connections>
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Support Mac OS X 10.10 or later.
|`←`| Move left 1px.|
|`→`| Move right 1px.|
|`↓`| Move down 1px.|
|`Shift ↑`| Move up 10px.|
|`Shift ←`| Move left 10px.|
|`Shift →`| Move right 10px.|
|`Shift ↓`| Move down 10px.|

### Alpha

Expand Down