Add preference to disable ctrl/cmd+mouse1 combo

This commit is contained in:
Jakub Valtar
2016-05-13 13:05:32 +02:00
parent 8142320cda
commit 33dc961f1b
2 changed files with 8 additions and 1 deletions

View File

@@ -316,6 +316,7 @@ public class JavaMode extends Mode {
static public volatile boolean defaultAutoSaveEnabled = true;
static public volatile boolean ccTriggerEnabled = false;
static public volatile boolean importSuggestEnabled = true;
static public volatile boolean inspectModeHotkeyEnabled = true;
static public int autoSaveInterval = 3; //in minutes
@@ -337,6 +338,7 @@ public class JavaMode extends Mode {
static public final String COMPLETION_PREF = "pdex.completion";
static public final String COMPLETION_TRIGGER_PREF = "pdex.completion.trigger";
static public final String SUGGEST_IMPORTS_PREF = "pdex.suggest.imports";
static public final String INSPECT_MODE_HOTKEY_PREF = "pdex.inspectMode.hotkey";
// static volatile public boolean enableTweak = false;
@@ -361,6 +363,7 @@ public class JavaMode extends Mode {
defaultAutoSaveEnabled = Preferences.getBoolean(prefDefaultAutoSave);
ccTriggerEnabled = Preferences.getBoolean(COMPLETION_TRIGGER_PREF);
importSuggestEnabled = Preferences.getBoolean(SUGGEST_IMPORTS_PREF);
inspectModeHotkeyEnabled = Preferences.getBoolean(INSPECT_MODE_HOTKEY_PREF);
loadSuggestionsMap();
}
@@ -379,6 +382,7 @@ public class JavaMode extends Mode {
Preferences.setBoolean(prefDefaultAutoSave, defaultAutoSaveEnabled);
Preferences.setBoolean(COMPLETION_TRIGGER_PREF, ccTriggerEnabled);
Preferences.setBoolean(SUGGEST_IMPORTS_PREF, importSuggestEnabled);
Preferences.setBoolean(INSPECT_MODE_HOTKEY_PREF, inspectModeHotkeyEnabled);
}
public void loadSuggestionsMap() {
@@ -449,6 +453,8 @@ public class JavaMode extends Mode {
Preferences.setBoolean(COMPLETION_TRIGGER_PREF, ccTriggerEnabled);
if (Preferences.get(SUGGEST_IMPORTS_PREF) == null)
Preferences.setBoolean(SUGGEST_IMPORTS_PREF, importSuggestEnabled);
if (Preferences.get(INSPECT_MODE_HOTKEY_PREF) == null)
Preferences.setBoolean(INSPECT_MODE_HOTKEY_PREF, inspectModeHotkeyEnabled);
}

View File

@@ -214,7 +214,8 @@ public class PDEX {
public void mouseReleased(MouseEvent e) {
boolean releasingMouse1 = e.getButton() == MouseEvent.BUTTON1;
boolean releasingMouse2 = e.getButton() == MouseEvent.BUTTON2;
if (inspectModeEnabled && isMouse1Down && releasingMouse1) {
if (JavaMode.inspectModeHotkeyEnabled && inspectModeEnabled &&
isMouse1Down && releasingMouse1) {
handleInspect(e);
} else if (!inspectModeEnabled && isMouse2Down && releasingMouse2) {
handleInspect(e);