mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
possible fix for bug #162, adds ctrl-ins, shift-ins, shift-del
This commit is contained in:
@@ -70,6 +70,9 @@ public abstract class InputHandler extends KeyAdapter
|
||||
public static final ActionListener SELECT_PREV_WORD = new prev_word(true);
|
||||
public static final ActionListener REPEAT = new repeat();
|
||||
public static final ActionListener TOGGLE_RECT = new toggle_rect();
|
||||
public static final ActionListener CLIPBOARD_CUT = new clipboard_cut(); // [fry]
|
||||
public static final ActionListener CLIPBOARD_COPY = new clipboard_copy();
|
||||
public static final ActionListener CLIPBOARD_PASTE = new clipboard_paste();
|
||||
|
||||
// Default action
|
||||
public static final ActionListener INSERT_CHAR = new insert_char();
|
||||
@@ -113,6 +116,9 @@ public abstract class InputHandler extends KeyAdapter
|
||||
actions.put("repeat",REPEAT);
|
||||
actions.put("toggle-rect",TOGGLE_RECT);
|
||||
actions.put("insert-char",INSERT_CHAR);
|
||||
actions.put("clipboard-cut",CLIPBOARD_CUT);
|
||||
actions.put("clipboard-copy",CLIPBOARD_COPY);
|
||||
actions.put("clipboard-paste",CLIPBOARD_PASTE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1076,6 +1082,34 @@ public abstract class InputHandler extends KeyAdapter
|
||||
!textArea.isSelectionRectangular());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class clipboard_cut implements ActionListener
|
||||
{
|
||||
public void actionPerformed(ActionEvent evt)
|
||||
{
|
||||
getTextArea(evt).cut();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class clipboard_copy implements ActionListener
|
||||
{
|
||||
public void actionPerformed(ActionEvent evt)
|
||||
{
|
||||
getTextArea(evt).copy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class clipboard_paste implements ActionListener
|
||||
{
|
||||
public void actionPerformed(ActionEvent evt)
|
||||
{
|
||||
getTextArea(evt).paste();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class insert_char implements ActionListener,
|
||||
InputHandler.NonRepeatable
|
||||
|
||||
@@ -57,6 +57,15 @@ public class PdeTextAreaDefaults extends TextAreaDefaults {
|
||||
//inputHandler.addKeyBinding("TAB", InputHandler.INSERT_TAB);
|
||||
|
||||
inputHandler.addKeyBinding("INSERT", InputHandler.OVERWRITE);
|
||||
|
||||
// http://dev.processing.org/bugs/show_bug.cgi?id=162
|
||||
// added for 0176, though the bindings do not appear relevant for osx
|
||||
if (!Base.isMacOS()) {
|
||||
inputHandler.addKeyBinding("C+INSERT", InputHandler.CLIPBOARD_COPY);
|
||||
inputHandler.addKeyBinding("S+INSERT", InputHandler.CLIPBOARD_PASTE);
|
||||
inputHandler.addKeyBinding("S+DELETE", InputHandler.CLIPBOARD_CUT);
|
||||
}
|
||||
|
||||
// disabling for 0122, not sure what this does
|
||||
//inputHandler.addKeyBinding("C+\\", InputHandler.TOGGLE_RECT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user