diff --git a/src/main/java/org/warp/picalculator/Utils.java b/src/main/java/org/warp/picalculator/Utils.java index f2c79f5c..5b896acc 100755 --- a/src/main/java/org/warp/picalculator/Utils.java +++ b/src/main/java/org/warp/picalculator/Utils.java @@ -107,6 +107,7 @@ public class Utils { .replace(""+MathematicalSymbols.ARC_TANGENT, "atan") .replace(""+MathematicalSymbols.UNDEFINED, "undefined") .replace(""+MathematicalSymbols.PI, "PI") + .replace(""+MathematicalSymbols.EULER_NUMBER, "EULER_NUMBER") .replace(""+MathematicalSymbols.X, "X") .replace(""+MathematicalSymbols.Y, "Y") ; diff --git a/src/main/java/org/warp/picalculator/device/Key.java b/src/main/java/org/warp/picalculator/device/Key.java index 1aa44821..ec390010 100644 --- a/src/main/java/org/warp/picalculator/device/Key.java +++ b/src/main/java/org/warp/picalculator/device/Key.java @@ -8,5 +8,5 @@ public enum Key { PLUS, MINUS, PLUS_MINUS, MULTIPLY, DIVIDE, EQUAL, DELETE, RESET, LEFT, RIGHT, UP, DOWN, OK, debug1, debug2, debug3, debug4, debug5, SQRT, ROOT, POWER_OF_2, POWER_OF_x, SINE, COSINE, TANGENT, ARCSINE, ARCCOSINE, ARCTANGENT, PI, SETTINGS, - F1, F2, F3, F4, BACK, ZOOM_MODE, LOGARITHM + F1, F2, F3, F4, BACK, ZOOM_MODE, LOGARITHM, EULER_NUMBER } \ No newline at end of file diff --git a/src/main/java/org/warp/picalculator/device/Keyboard.java b/src/main/java/org/warp/picalculator/device/Keyboard.java index 7bf4db62..09c23a16 100755 --- a/src/main/java/org/warp/picalculator/device/Keyboard.java +++ b/src/main/java/org/warp/picalculator/device/Keyboard.java @@ -170,6 +170,15 @@ public class Keyboard { Keyboard.keyPressed(Key.NONE); } break; + case KeyEvent.VK_E: + if (Keyboard.shift) { + Keyboard.keyPressed(Key.NONE); + } else if (Keyboard.alpha) { + Keyboard.keyPressed(Key.NONE); + } else { + Keyboard.keyPressed(Key.EULER_NUMBER); + } + break; case KeyEvent.VK_Y: if (Keyboard.alpha) { Keyboard.keyPressed(Key.LETTER_Y); diff --git a/src/main/java/org/warp/picalculator/gui/expression/InputContext.java b/src/main/java/org/warp/picalculator/gui/expression/InputContext.java index b51256fc..38824ed2 100644 --- a/src/main/java/org/warp/picalculator/gui/expression/InputContext.java +++ b/src/main/java/org/warp/picalculator/gui/expression/InputContext.java @@ -13,6 +13,7 @@ public class InputContext { public InputContext() { this.variableTypes = new HashMap<>(); this.variableTypes.put(MathematicalSymbols.PI, V_TYPE.CONSTANT); + this.variableTypes.put(MathematicalSymbols.EULER_NUMBER, V_TYPE.CONSTANT); } public InputContext(HashMap variableTypes) { diff --git a/src/main/java/org/warp/picalculator/gui/expression/containers/NormalInputContainer.java b/src/main/java/org/warp/picalculator/gui/expression/containers/NormalInputContainer.java index bb200d5d..c6dd59b0 100755 --- a/src/main/java/org/warp/picalculator/gui/expression/containers/NormalInputContainer.java +++ b/src/main/java/org/warp/picalculator/gui/expression/containers/NormalInputContainer.java @@ -76,6 +76,8 @@ public class NormalInputContainer extends InputContainer { return new BlockLogarithm(); case MathematicalSymbols.PI: return new BlockVariable(inputContext, c, true); + case MathematicalSymbols.EULER_NUMBER: + return new BlockVariable(inputContext, c, true); default: for (char v : MathematicalSymbols.variables) { if (c == v) { diff --git a/src/main/java/org/warp/picalculator/gui/graphicengine/cpu/CPUFont.java b/src/main/java/org/warp/picalculator/gui/graphicengine/cpu/CPUFont.java index 3b8fe502..5d124a9f 100755 --- a/src/main/java/org/warp/picalculator/gui/graphicengine/cpu/CPUFont.java +++ b/src/main/java/org/warp/picalculator/gui/graphicengine/cpu/CPUFont.java @@ -110,7 +110,7 @@ public class CPUFont implements BinaryFont { minBound = file[0x9] << 24 | file[0xA] << 16 | file[0xB] << 8 | file[0xC]; maxBound = file[0xE] << 24 | file[0xF] << 16 | file[0x10] << 8 | file[0x11]; if (maxBound <= minBound) { - maxBound = 9900; //TODO remove it: temp fix + maxBound = 66000; //TODO remove it: temp fix } rawchars = new boolean[maxBound - minBound][]; int index = 0x12; diff --git a/src/main/java/org/warp/picalculator/gui/screens/MathInputScreen.java b/src/main/java/org/warp/picalculator/gui/screens/MathInputScreen.java index 5cbe6e29..3d9f5d57 100755 --- a/src/main/java/org/warp/picalculator/gui/screens/MathInputScreen.java +++ b/src/main/java/org/warp/picalculator/gui/screens/MathInputScreen.java @@ -337,6 +337,9 @@ public class MathInputScreen extends Screen { case PI: typeChar(MathematicalSymbols.PI); return true; + case EULER_NUMBER: + typeChar(MathematicalSymbols.EULER_NUMBER); + return true; case LETTER_X: typeChar(MathematicalSymbols.variables[23]); return true; diff --git a/src/main/java/org/warp/picalculator/math/MathematicalSymbols.java b/src/main/java/org/warp/picalculator/math/MathematicalSymbols.java index a1e9136d..11805572 100755 --- a/src/main/java/org/warp/picalculator/math/MathematicalSymbols.java +++ b/src/main/java/org/warp/picalculator/math/MathematicalSymbols.java @@ -28,6 +28,7 @@ public class MathematicalSymbols { public static final char LOGARITHM = 'Ⓙ'; public static final char UNDEFINED = '∅'; public static final char PI = 'π'; + public static final char EULER_NUMBER = 'e'; public static final char X = 'ⓧ'; public static final char Y = 'Ⓨ'; @@ -52,7 +53,7 @@ public class MathematicalSymbols { public static final char[] parentheses = new char[] { PARENTHESIS_OPEN, PARENTHESIS_CLOSE }; - public static final char[] variables = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', X, Y, 'Z', PI, UNDEFINED }; + public static final char[] variables = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', X, Y, 'Z', PI, EULER_NUMBER, UNDEFINED }; public static final char[] genericSyntax = new char[] { SYSTEM, EQUATION }; diff --git a/src/main/resources/font_norm.rft b/src/main/resources/font_norm.rft index cad2657c..d4e5e1e7 100644 Binary files a/src/main/resources/font_norm.rft and b/src/main/resources/font_norm.rft differ diff --git a/src/main/resources/font_smal.rft b/src/main/resources/font_smal.rft index a61b6966..bd07662e 100644 Binary files a/src/main/resources/font_smal.rft and b/src/main/resources/font_smal.rft differ