Skip to content

Commit

Permalink
fix wh hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
Exslims committed Oct 24, 2017
1 parent 726a18e commit 915748d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class NotificationSettingsDescriptor implements Serializable {
private boolean outNotificationEnable = true;
private boolean scannerNotificationEnable = true;
private boolean whisperHelperEnable = false;
private HotKeyDescriptor whisperHelperHotKey = new HotKeyDescriptor("Ctrl", 29, false, false, true);
private HotKeyDescriptor whisperHelperHotKey = new HotKeyDescriptor("F2", 60, false, false, false);
private int limitCount = 3;
private int unfoldCount = 2;
private FlowDirections flowDirections = FlowDirections.DOWNWARDS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public void nativeKeyPressed(NativeKeyEvent nativeKeyEvent) {

@Override
public void nativeKeyReleased(NativeKeyEvent nativeKeyEvent) {
if (!this.block) {
MercuryStoreCore.hotKeyReleaseSubject.onNext(this.getDescriptor(nativeKeyEvent));
}
switch (nativeKeyEvent.getKeyCode()) {
case 42: {
shiftPressed = false;
Expand All @@ -55,10 +58,6 @@ public void nativeKeyReleased(NativeKeyEvent nativeKeyEvent) {
break;
}
}
if (!this.block) {
MercuryStoreCore.hotKeyReleaseSubject.onNext(this.getDescriptor(nativeKeyEvent));
}

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class NotificationSettingsPagePanel extends SettingsPagePanel {

private HotKeyGroup incHotkeyGroup;
private HotKeyGroup outHotkeyGroup;
private HotKeyGroup whHotkeyGroup;
private HotKeyGroup scannerHotkeyGroup;

@Override
Expand All @@ -42,6 +43,7 @@ public void onViewInit() {

this.incHotkeyGroup = new HotKeyGroup();
this.outHotkeyGroup = new HotKeyGroup();
this.whHotkeyGroup = new HotKeyGroup();
this.scannerHotkeyGroup = new HotKeyGroup();

JPanel whisperHelperPanel = this.adrComponentsFactory.getCounterPanel(this.getWhisperHelperPanel(), "Whisper helper:", AppThemeColor.ADR_BG, false);
Expand Down Expand Up @@ -133,7 +135,9 @@ private JPanel getWhisperHelperPanel() {
parametersPanel.add(this.componentsFactory.getTextLabel("Enabled:", FontStyle.REGULAR, 16));
parametersPanel.add(enableCheckbox);
parametersPanel.add(this.componentsFactory.getTextLabel("Hotkey:", FontStyle.REGULAR, 16));
parametersPanel.add(new HotKeyPanel(this.generalSnapshot.getWhisperHelperHotKey()));
HotKeyPanel hotKeyPanel = new HotKeyPanel(this.generalSnapshot.getWhisperHelperHotKey());
this.whHotkeyGroup.registerHotkey(hotKeyPanel);
parametersPanel.add(hotKeyPanel);

JPanel showcasePanel = this.componentsFactory.getJPanel(new BorderLayout(), AppThemeColor.ADR_BG);
showcasePanel.add(this.componentsFactory.getTextLabel("When you release hotkey button clipboard content will be transferred to chat.", FontStyle.REGULAR, 16), BorderLayout.PAGE_START);
Expand Down

0 comments on commit 915748d

Please sign in to comment.