Skip to content
Snippets Groups Projects
Commit c3d2d432 authored by George Nachman's avatar George Nachman
Browse files

Show a warning if the shortcut to toggle the app is the same as the shortcut...

Show a warning if the shortcut to toggle the app is the same as the shortcut to toggle a profile window.

Also fix a bug where duplicate warnings wouldn't be shown if some irrelevant modifier flag bits were set.

Issue 5882
parent 20c0c6a2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1324,6 +1324,7 @@ DQ
<connections>
<outlet property="_configureHotKeyWindow" destination="yqL-PV-QBa" id="ujI-sN-AKS"/>
<outlet property="_controlButton" destination="4237" id="rOx-d6-9bm"/>
<outlet property="_horizontalLine" destination="rqh-BU-WS4" id="dAk-0w-jkA"/>
<outlet property="_hotkeyEnabled" destination="5104" id="QVB-Xu-fmz"/>
<outlet property="_hotkeyField" destination="5105" id="7JV-k6-QEN"/>
<outlet property="_hotkeyLabel" destination="5106" id="nqf-CS-llf"/>
Loading
Loading
@@ -1331,6 +1332,7 @@ DQ
<outlet property="_leftOptionButton" destination="4383" id="kbJ-KW-Hkc"/>
<outlet property="_rightCommandButton" destination="4410" id="xeL-Ll-jEw"/>
<outlet property="_rightOptionButton" destination="4392" id="zkG-aT-oOV"/>
<outlet property="_shortcutOverloaded" destination="6qd-z9-t1q" id="8cO-cF-n8h"/>
<outlet property="_switchPaneModifierButton" destination="LXv-KO-6t6" id="WEu-r7-Lu6"/>
<outlet property="_switchTabModifierButton" destination="4118" id="m16-Tk-0hv"/>
<outlet property="_switchWindowModifierButton" destination="4269" id="LkQ-lj-KIU"/>
Loading
Loading
@@ -3448,7 +3450,7 @@ DQ
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="ArV-0K-qze">
<rect key="frame" x="1" y="1" width="511" height="95"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" id="5661">
<rect key="frame" x="0.0" y="0.0" width="511" height="95"/>
Loading
Loading
@@ -5016,12 +5018,12 @@ DQ
</subviews>
<point key="canvasLocation" x="-263" y="1211"/>
</customView>
<customView id="Z7N-XT-vVo" userLabel="Prefs - Keys" customClass="iTermSizeRememberingView">
<rect key="frame" x="0.0" y="0.0" width="932" height="402"/>
<customView misplaced="YES" id="Z7N-XT-vVo" userLabel="Prefs - Keys" customClass="iTermSizeRememberingView">
<rect key="frame" x="0.0" y="0.0" width="932" height="420"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="3658">
<rect key="frame" x="18" y="384" width="146" height="17"/>
<rect key="frame" x="18" y="402" width="146" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Remap Modifier Keys" id="3659">
<font key="font" metaFont="systemBold"/>
Loading
Loading
@@ -5030,7 +5032,7 @@ DQ
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="3866">
<rect key="frame" x="382" y="384" width="151" height="17"/>
<rect key="frame" x="382" y="402" width="151" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Key Mappings" id="3867">
<font key="font" metaFont="systemBold"/>
Loading
Loading
@@ -5039,7 +5041,7 @@ DQ
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="3673">
<rect key="frame" x="38" y="364" width="143" height="17"/>
<rect key="frame" x="38" y="382" width="143" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Control (⌃) key:" id="3674">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5048,7 +5050,7 @@ DQ
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="3689">
<rect key="frame" x="38" y="339" width="143" height="17"/>
<rect key="frame" x="38" y="357" width="143" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Left option (⌥) key:" id="3690">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5057,7 +5059,7 @@ DQ
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="3675">
<rect key="frame" x="35" y="314" width="146" height="17"/>
<rect key="frame" x="35" y="332" width="146" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Right option (⌥) key:" id="3676">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5066,7 +5068,7 @@ DQ
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="3677">
<rect key="frame" x="28" y="289" width="153" height="17"/>
<rect key="frame" x="28" y="307" width="153" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Left command (⌘) key:" id="3678">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5075,7 +5077,7 @@ DQ
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" id="4237">
<rect key="frame" x="184" y="358" width="163" height="26"/>
<rect key="frame" x="184" y="376" width="163" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="4238">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -5104,7 +5106,7 @@ DQ
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="4383">
<rect key="frame" x="184" y="333" width="163" height="26"/>
<rect key="frame" x="184" y="351" width="163" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="⌥ Left Option" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="2" imageScaling="proportionallyDown" inset="2" selectedItem="4387" id="4384">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -5133,7 +5135,7 @@ DQ
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="4392">
<rect key="frame" x="184" y="308" width="163" height="26"/>
<rect key="frame" x="184" y="326" width="163" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="⌥ Right Option" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="3" imageScaling="proportionallyDown" inset="2" selectedItem="4407" id="4401">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -5162,7 +5164,7 @@ DQ
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="4393">
<rect key="frame" x="184" y="283" width="163" height="26"/>
<rect key="frame" x="184" y="301" width="163" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="⌘ Left Command" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="7" imageScaling="proportionallyDown" inset="2" selectedItem="4398" id="4394">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -5190,7 +5192,7 @@ DQ
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="4410">
<rect key="frame" x="184" y="257" width="163" height="26"/>
<rect key="frame" x="184" y="275" width="163" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="⌘ Right Command" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="8" imageScaling="proportionallyDown" inset="2" selectedItem="4413" id="4411">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -5219,7 +5221,7 @@ DQ
</connections>
</popUpButton>
<textField verticalHuggingPriority="750" id="4335">
<rect key="frame" x="18" y="263" width="163" height="17"/>
<rect key="frame" x="18" y="281" width="163" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Right command (⌘) key:" id="4343">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5227,8 +5229,8 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" id="4118">
<rect key="frame" x="184" y="158" width="72" height="26"/>
<popUpButton verticalHuggingPriority="750" misplaced="YES" id="4118">
<rect key="frame" x="184" y="176" width="161" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="⌥⌘" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="6" imageScaling="proportionallyDown" inset="2" autoenablesItems="NO" selectedItem="4137" id="4129">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -5255,8 +5257,8 @@ DQ
<outlet property="nextKeyView" destination="4269" id="5294"/>
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="4269">
<rect key="frame" x="184" y="128" width="72" height="26"/>
<popUpButton verticalHuggingPriority="750" misplaced="YES" id="4269">
<rect key="frame" x="184" y="146" width="161" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="⌥⌘" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="6" imageScaling="proportionallyDown" inset="2" autoenablesItems="NO" selectedItem="4273" id="4270">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -5284,7 +5286,7 @@ DQ
</connections>
</popUpButton>
<textField verticalHuggingPriority="750" id="3892">
<rect key="frame" x="18" y="224" width="153" height="17"/>
<rect key="frame" x="18" y="242" width="153" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Navigation Shortcuts" id="3893">
<font key="font" metaFont="systemBold"/>
Loading
Loading
@@ -5292,26 +5294,8 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="4085">
<rect key="frame" x="258" y="164" width="65" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="+Number" id="4086">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="4231">
<rect key="frame" x="258" y="134" width="65" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="+Number" id="4232">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="4219">
<rect key="frame" x="82" y="164" width="99" height="17"/>
<textField verticalHuggingPriority="750" misplaced="YES" id="4219">
<rect key="frame" x="82" y="182" width="99" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="To switch tabs:" id="4220">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5319,24 +5303,24 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" id="LXv-KO-6t6">
<rect key="frame" x="184" y="187" width="72" height="26"/>
<popUpButton verticalHuggingPriority="750" misplaced="YES" id="LXv-KO-6t6">
<rect key="frame" x="184" y="205" width="163" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="⌥⌘" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="6" imageScaling="proportionallyDown" inset="2" autoenablesItems="NO" selectedItem="a9h-ca-fto" id="T7I-ty-osf">
<popUpButtonCell key="cell" type="push" title="⌥⌘ Number" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" tag="6" imageScaling="proportionallyDown" inset="2" autoenablesItems="NO" selectedItem="a9h-ca-fto" id="T7I-ty-osf">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" title="OtherViews" autoenablesItems="NO" id="G8M-3E-Bit">
<items>
<menuItem tag="9" id="dAC-MA-Mtf">
<menuItem title="No Shortcut" state="on" tag="9" id="dAC-MA-Mtf">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="⌥" tag="5" id="vlQ-02-Vie">
<menuItem title="⌥ Number" tag="5" id="vlQ-02-Vie">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="⌘" tag="4" id="oGG-n4-dNs">
<menuItem title="⌘ Number" tag="4" id="oGG-n4-dNs">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="⌥⌘" state="on" tag="6" id="a9h-ca-fto">
<menuItem title="⌥⌘ Number" tag="6" id="a9h-ca-fto">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
</items>
Loading
Loading
@@ -5347,17 +5331,8 @@ DQ
<outlet property="nextKeyView" destination="4269" id="TZv-VG-ywY"/>
</connections>
</popUpButton>
<textField verticalHuggingPriority="750" id="auQ-G1-yHB">
<rect key="frame" x="258" y="193" width="65" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="+Number" id="A8L-Oi-nQh">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="4223">
<rect key="frame" x="53" y="134" width="128" height="17"/>
<textField verticalHuggingPriority="750" misplaced="YES" id="4223">
<rect key="frame" x="53" y="152" width="128" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="To switch windows:" id="4224">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5365,12 +5340,12 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<box horizontalHuggingPriority="750" boxType="separator" id="5080">
<rect key="frame" x="357" y="20" width="5" height="381"/>
<box horizontalHuggingPriority="750" misplaced="YES" boxType="separator" id="5080">
<rect key="frame" x="357" y="24" width="5" height="395"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</box>
<textField verticalHuggingPriority="750" id="5103">
<rect key="frame" x="18" y="99" width="153" height="17"/>
<rect key="frame" x="18" y="117" width="153" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Hotkey" id="5116">
<font key="font" metaFont="systemBold"/>
Loading
Loading
@@ -5379,7 +5354,7 @@ DQ
</textFieldCell>
</textField>
<button id="5104">
<rect key="frame" x="20" y="75" width="324" height="18"/>
<rect key="frame" x="20" y="93" width="324" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Show/hide all windows with a system-wide hotkey" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="5115">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Loading
Loading
@@ -5391,7 +5366,7 @@ DQ
</connections>
</button>
<textField verticalHuggingPriority="750" id="5105" customClass="iTermShortcutInputView">
<rect key="frame" x="103" y="47" width="241" height="22"/>
<rect key="frame" x="103" y="65" width="241" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="5114">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5403,7 +5378,7 @@ DQ
</connections>
</textField>
<textField verticalHuggingPriority="750" id="5106">
<rect key="frame" x="48" y="49" width="53" height="17"/>
<rect key="frame" x="48" y="67" width="53" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Hotkey:" id="5113">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5411,12 +5386,12 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<customView id="zLA-QA-WQd">
<rect key="frame" x="384" y="20" width="528" height="361"/>
<customView misplaced="YES" id="zLA-QA-WQd">
<rect key="frame" x="376" y="20" width="536" height="379"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="Z54-N2-Thm">
<rect key="frame" x="43" y="193" width="137" height="17"/>
<rect key="frame" x="43" y="211" width="137" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="To switch split panes:" id="wrs-RL-mgS">
<font key="font" metaFont="system"/>
Loading
Loading
@@ -5424,8 +5399,17 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" id="yqL-PV-QBa">
<rect key="frame" x="16" y="13" width="334" height="32"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" id="6qd-z9-t1q">
<rect key="frame" x="101" y="49" width="207" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="⚠️ A profile also uses this shortcut" id="FcK-Mk-rxx">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" misplaced="YES" id="yqL-PV-QBa">
<rect key="frame" x="16" y="17" width="334" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Create a Dedicated Hotkey Window…" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="FYp-1N-mV9">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -5435,8 +5419,12 @@ DQ
<action selector="configureHotKeyWindow:" target="8TE-cq-5cL" id="1B5-mJ-TKE"/>
</connections>
</button>
<box verticalHuggingPriority="750" misplaced="YES" boxType="separator" id="rqh-BU-WS4">
<rect key="frame" x="20" y="53" width="324" height="5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</box>
</subviews>
<point key="canvasLocation" x="756" y="-227"/>
<point key="canvasLocation" x="756" y="-218"/>
</customView>
<customView id="rwh-oX-e8l" userLabel="Prefs - Arrangements" customClass="iTermSizeRememberingView">
<rect key="frame" x="0.0" y="0.0" width="911" height="433"/>
Loading
Loading
Loading
Loading
@@ -40,6 +40,8 @@ static NSString *const kHotkeyWindowGeneratedProfileNameKey = @"Hotkey Window";
 
// Hotkey
IBOutlet NSButton *_hotkeyEnabled;
IBOutlet NSView *_horizontalLine;
IBOutlet NSTextField *_shortcutOverloaded;
IBOutlet NSTextField *_hotkeyField;
IBOutlet NSTextField *_hotkeyLabel;
IBOutlet NSButton *_configureHotKeyWindow;
Loading
Loading
@@ -117,6 +119,28 @@ static NSString *const kHotkeyWindowGeneratedProfileNameKey = @"Hotkey Window";
type:kPreferenceInfoTypeCheckbox];
info.onChange = ^() { [self hotkeyEnabledDidChange]; };
info.observer = ^() { [self updateHotkeyViews]; };
[self updateDuplicateWarning];
}
- (void)viewWillAppear {
[self updateDuplicateWarning];
}
- (iTermHotKeyDescriptor *)hotkeyDescriptor {
int theChar = [iTermPreferences intForKey:kPreferenceKeyHotkeyCharacter];
int modifiers = [iTermPreferences intForKey:kPreferenceKeyHotkeyModifiers];
int code = [iTermPreferences intForKey:kPreferenceKeyHotKeyCode];
if (code || theChar) {
return [NSDictionary descriptorWithKeyCode:code modifiers:modifiers];
} else {
return nil;
}
}
- (void)updateDuplicateWarning {
NSArray<iTermHotKeyDescriptor *> *descriptors = [[iTermHotKeyController sharedInstance] descriptorsForProfileHotKeysExcept:nil];
_shortcutOverloaded.hidden = ![descriptors containsObject:[self hotkeyDescriptor]];
_horizontalLine.hidden = !_shortcutOverloaded.hidden;
}
 
- (void)ensureUniqunessOfModifierForButton:(NSPopUpButton *)buttonThatChanged
Loading
Loading
@@ -253,6 +277,7 @@ static NSString *const kHotkeyWindowGeneratedProfileNameKey = @"Hotkey Window";
BOOL isEnabled = [iTermPreferences boolForKey:kPreferenceKeyHotkeyEnabled];
_hotkeyField.enabled = isEnabled;
_hotkeyLabel.labelEnabled = isEnabled;
[self updateDuplicateWarning];
}
 
// Set the local copy of the hotkey, update the pref panel, and register it after a delay.
Loading
Loading
Loading
Loading
@@ -27,6 +27,11 @@ static NSString *const kHotKeyKeyCode = @"keyCode";
static NSString *const kHotKeyModifiers = @"modifiers";
static NSString *const kHotKeyModifierActivation = @"modifier activation";
 
static const NSEventModifierFlags iTermHotkeyModifierMask = (NSEventModifierFlagCommand |
NSEventModifierFlagControl |
NSEventModifierFlagOption |
NSEventModifierFlagShift);
@interface NSArray(SizeEstimation)
@end
 
Loading
Loading
@@ -256,7 +261,7 @@ static NSString *const kHotKeyModifierActivation = @"modifier activation";
+ (NSDictionary *)descriptorWithKeyCode:(NSUInteger)keyCode
modifiers:(NSEventModifierFlags)modifiers {
return @{ kHotKeyKeyCode: @(keyCode),
kHotKeyModifiers: @(modifiers) };
kHotKeyModifiers: @(modifiers & iTermHotkeyModifierMask) };
}
 
+ (iTermHotKeyDescriptor *)descriptorWithModifierActivation:(iTermHotKeyModifierActivation)activation {
Loading
Loading
@@ -268,7 +273,7 @@ static NSString *const kHotKeyModifierActivation = @"modifier activation";
}
 
- (NSEventModifierFlags)hotKeyModifiers {
return [self[kHotKeyModifiers] unsignedIntegerValue];
return [self[kHotKeyModifiers] unsignedIntegerValue] & iTermHotkeyModifierMask;
}
 
- (iTermHotKeyModifierActivation)hotKeyModifierActivation {
Loading
Loading
Loading
Loading
@@ -279,7 +279,7 @@ NSString *const TERMINAL_ARRANGEMENT_PROFILE_GUID = @"Hotkey Profile GUID";
if ([iTermProfilePreferences boolForKey:KEY_HOTKEY_ACTIVATE_WITH_MODIFIER inProfile:profileHotKey.profile]) {
iTermHotKeyModifierActivation modifierActivation =
[iTermProfilePreferences unsignedIntegerForKey:KEY_HOTKEY_MODIFIER_ACTIVATION
inProfile:profileHotKey.profile];;
inProfile:profileHotKey.profile];
[result addObject:[iTermHotKeyDescriptor descriptorWithModifierActivation:modifierActivation]];
}
return result;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment