- Timestamp:
- 09/13/18 15:15:05 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java
r1122 r1126 400 400 public void exec(Gesture gesture) { 401 401 InsertStringGestureData data = (InsertStringGestureData) gesture.getData(); 402 for (char c : data.getString().toCharArray()) processChar(c, data.isShiftDown()); 402 for (char c : data.getString().toCharArray()) { 403 processChar(c, data.isShiftDown()); 404 } 403 405 } 404 406 }); … … 1125 1127 assert (_toRemove.getLength() == 0); 1126 1128 // This line is to protect mistaken removal of items if there is a bug... 1127 if (_toRemove.getLength() == 0) DisplayController.getCurrentFrame().removeItem(_toRemove); 1129 if (_toRemove.getLength() == 0) { 1130 DisplayController.getCurrentFrame().removeItem(_toRemove); 1131 } 1128 1132 } 1129 1133 _toRemove = null; 1130 1134 1131 1135 // ignore delete and backspace if in free space 1132 if ((on == null || !(on instanceof Text)) && (ch == '\b' || ch == '\t' || ch == Text.DELETE_CHARACTER)) return; 1136 if ((on == null || !(on instanceof Text)) 1137 && (ch == '\b' || ch == '\t' || ch == Text.DELETE_CHARACTER)) { 1138 return; 1139 } 1133 1140 1134 1141 SessionStats.TypedChar(ch); … … 1144 1151 1145 1152 // only text can interact with keyboard events 1146 if (on != null && !(on instanceof Text)) on = null; 1153 if (on != null && !(on instanceof Text)) { 1154 on = null; 1155 } 1147 1156 1148 1157 // DisplayIO.UpdateTitle(); … … 1206 1215 public static Text insertCharacterAction(Text text, boolean isShiftDown, final char c) 1207 1216 { 1208 float oldY = DisplayController.getFloatMouseY(); 1217 final float oldY = DisplayController.getFloatMouseY(); 1218 final float oldX = DisplayController.getFloatMouseX(); 1219 System.err.println("insertCharacterAction: Prior to inserting character mouse at: " + oldX + "," + oldY); 1209 1220 Point newMouse = null; 1210 1221 if (c == '\t') { 1211 1222 if (isShiftDown) { 1212 newMouse = text.removeTab(c, DisplayController.getFloatMouseX(), DisplayController.getFloatMouseY());1223 newMouse = text.removeTab(c, oldX, oldY); 1213 1224 } else { 1214 newMouse = text.insertTab(c, DisplayController.getFloatMouseX(), DisplayController.getFloatMouseY());1225 newMouse = text.insertTab(c, oldX, oldY); 1215 1226 } 1216 1227 } else { 1217 newMouse = text.insertChar(c, DisplayController.getFloatMouseX(), DisplayController.getFloatMouseY());1228 newMouse = text.insertChar(c, oldX, DisplayController.getFloatMouseY()); 1218 1229 } 1219 1230
Note:
See TracChangeset
for help on using the changeset viewer.