fixed hotkeys in control panel to use character not key code
This commit is contained in:
@@ -70,7 +70,7 @@ public class Config extends PropertiesSerializer {
|
|||||||
alwaysOnTop=aNewValue?"true":"false";
|
alwaysOnTop=aNewValue?"true":"false";
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRefreshKeyCode()
|
public char getRefreshKey()
|
||||||
{
|
{
|
||||||
String keyStr = "";
|
String keyStr = "";
|
||||||
if (this.refreshKey == null)
|
if (this.refreshKey == null)
|
||||||
@@ -79,14 +79,19 @@ public class Config extends PropertiesSerializer {
|
|||||||
keyStr = new Config().refreshKey; //use default value
|
keyStr = new Config().refreshKey; //use default value
|
||||||
else
|
else
|
||||||
keyStr = this.refreshKey;
|
keyStr = this.refreshKey;
|
||||||
return RobotMacro.getKeyCode(keyStr.charAt(0))[0];
|
return keyStr.charAt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRefreshKeyCode(String aText) {
|
public int getRefreshKeyCode()
|
||||||
|
{
|
||||||
|
return RobotMacro.getKeyCode(this.getRefreshKey())[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefreshKey(String aText) {
|
||||||
this.refreshKey=aText;
|
this.refreshKey=aText;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTargetKeyCode()
|
public char getTargetKey()
|
||||||
{
|
{
|
||||||
String keyStr = "";
|
String keyStr = "";
|
||||||
if (this.targetKey == null)
|
if (this.targetKey == null)
|
||||||
@@ -95,10 +100,15 @@ public class Config extends PropertiesSerializer {
|
|||||||
keyStr = new Config().targetKey; //use default value
|
keyStr = new Config().targetKey; //use default value
|
||||||
else
|
else
|
||||||
keyStr = this.targetKey;
|
keyStr = this.targetKey;
|
||||||
return RobotMacro.getKeyCode(keyStr.charAt(0))[0];
|
return keyStr.charAt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTargetKeyCode(String aText) {
|
public int getTargetKeyCode()
|
||||||
|
{
|
||||||
|
return RobotMacro.getKeyCode(this.getTargetKey())[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTargetKey(String aText) {
|
||||||
this.targetKey=aText;
|
this.targetKey=aText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class PropertiesSerializer {
|
|||||||
fields[i].set(this, Boolean.parseBoolean(myProperty + ""));
|
fields[i].set(this, Boolean.parseBoolean(myProperty + ""));
|
||||||
else
|
else
|
||||||
fields[i].set(this, myProperty);
|
fields[i].set(this, myProperty);
|
||||||
// System.out.println("Property "+pName+"["+pType+"] set to: "+myProperty);
|
System.out.println("Property "+pName+"["+pType+"] set to: "+myProperty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ public class SynthuseConfigDialogControllers {
|
|||||||
aSynthuseConfigPanel.getAlwaysOnTopCheckBox().setSelected(aConfig.isAlwaysOnTop());
|
aSynthuseConfigPanel.getAlwaysOnTopCheckBox().setSelected(aConfig.isAlwaysOnTop());
|
||||||
aSynthuseConfigPanel.getDisableFiltersUiaCheckBox().setSelected(aConfig.isFilterUiaDisabled());
|
aSynthuseConfigPanel.getDisableFiltersUiaCheckBox().setSelected(aConfig.isFilterUiaDisabled());
|
||||||
aSynthuseConfigPanel.getDisableUiaBridgeCheckBox().setSelected(aConfig.isUiaBridgeDisabled());
|
aSynthuseConfigPanel.getDisableUiaBridgeCheckBox().setSelected(aConfig.isUiaBridgeDisabled());
|
||||||
aSynthuseConfigPanel.getRefreshKeyTextField().setText(Integer.toString(aConfig.getRefreshKeyCode()));
|
aSynthuseConfigPanel.getRefreshKeyTextField().setText(Character.toString(aConfig.getRefreshKey()));
|
||||||
aSynthuseConfigPanel.getStrongTextMatchingCheckBox().setSelected(aConfig.isUseStrongTextMatching());
|
aSynthuseConfigPanel.getStrongTextMatchingCheckBox().setSelected(aConfig.isUseStrongTextMatching());
|
||||||
aSynthuseConfigPanel.getTargetKeyTextField().setText(Integer.toString(aConfig.getTargetKeyCode()));
|
aSynthuseConfigPanel.getTargetKeyTextField().setText(Character.toString(aConfig.getTargetKey()));
|
||||||
aSynthuseConfigPanel.getXPathHighlightTextField().setText(aConfig.getXpathHighlight());
|
aSynthuseConfigPanel.getXPathHighlightTextField().setText(aConfig.getXpathHighlight());
|
||||||
aSynthuseConfigPanel.getXPathListTextField().setText(aConfig.getXpathList());
|
aSynthuseConfigPanel.getXPathListTextField().setText(aConfig.getXpathList());
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ public class SynthuseConfigDialogControllers {
|
|||||||
return new ActionListener() {
|
return new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent aE) {
|
public void actionPerformed(ActionEvent aE) {
|
||||||
aConfig.setTargetKeyCode(aSynthuseConfigPanel.getTargetKeyTextField().getText());
|
aConfig.setTargetKey(aSynthuseConfigPanel.getTargetKeyTextField().getText());
|
||||||
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -80,7 +80,7 @@ public class SynthuseConfigDialogControllers {
|
|||||||
return new ActionListener() {
|
return new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent aE) {
|
public void actionPerformed(ActionEvent aE) {
|
||||||
aConfig.setRefreshKeyCode(aSynthuseConfigPanel.getRefreshKeyTextField().getText());
|
aConfig.setRefreshKey(aSynthuseConfigPanel.getRefreshKeyTextField().getText());
|
||||||
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user