Keyboard shortcuts

Hello
Can somebody give me a list or say where I can find them , of all or at least the most important keyboard shortcuts as this would be very helpfull ?
Thanks in advance

1 Like

Hello,

and welcome to the forum!

Great to have you here!

Good question!

You can see the shortcuts in the menus of the processing IDE / Editor

Let me mention this first.

Productivity

In general, what gives you productivity?

  • Using Keyboard shortcuts is one aspect
  • Learn to type with 10 fingers really
  • be familiar with reference and example section (online and offline)
  • Use libraries like PeasyCam and G4P - don’t reinvent the wheel
  • have a couple of “Empty Sketches” ready, so you can just load them as a starting point. They are not really empty, but they contain stuff you usually need, like setup() and draw(). Or more advanced, setup, draw, a splash screen and a help screen and a headline and a status bar (https://en.wikipedia.org/wiki/Status_bar). They even can have multiple tabs. Examples: 2D or 3D, one with setup and draw, one with setup, draw, mousePressed, keyPressed, one with a full State System in draw(), mousePressed() and keyPressed(), one with a full 3D-stage and camera movement (see https://www.youtube.com/watch?v=unx6p_n7W90 where the castle is on the stage but the stage with sky and clouds is an empty sketch I use as a starting point to implement something on the stage).
  • Use something like AutoHotkey (AHK), see https://en.wikipedia.org/wiki/AutoHotkey ; you could store fancy functions there with short cuts

But I will list a few common short-cuts here.

In the IDE / Editor

There is the normal editor stuff like

  • ctrl-c, ctrl-v, ctrl-x, ctrl-a…
  • cursor and
  • ctrl-cursor left, ctrl-cursor right ctrl-cursor Up, ctrl-cursor Down…
  • Pos1 and End
  • ctrl-Pos1 and ctrl-End
  • Tab
  • Right mouse click for local menu

Then the normal program stuff like

  • Enter Menu with Alt-f, Alt-d etc. and maneuver with cursor or letters (like p for paste when in Menu Edit)
  • ctrl-n, ctrl-p, ctrl-s, ctrl-o (New, print, save, open)
  • ctrl-f Find

and then cool special stuff like

  • ctrl-t auto-format and auto-indent (I love it)
  • ctrl-r RUN
  • ctrl-Shift-F get offline reference for the selected command (nice!)
  • ctrl-k open the Sketch Folder: which is nice, when you want to look at the images of the Sketch etc.
  • ctrl-shift-N New tab (tabs are cool anyway)

In a running Sketch

In a running Sketch :

  • Escape : stop Sketch (Alt-F4 in Windows)

In the forum

when you hover the mouse over the buttons in the small command bar, short-cuts are displayed such as

  • ctrl-b, ctrl-i, ctrl-Shift-C

Mouse in the IDE/Editor

  • Click : Place cursor
  • Double-Click : select Word
  • Triple-Click : select Paragraph (or line)
  • Drag : select passage

Remark

For a list of Editor / IDE commands see https://www.processing.org/reference/environment/#PDE

Chrisir

3 Likes

I mentioned Empty Sketches.

You have them on your hard drive and you can load them and start programming.
You save them with a new name.

Here is a typical example:

For 2D




// 2D Sketch 

// ------------------------------------------------------------------------
// The two core functions

void setup() {
  size(800, 800);
} // func 

void draw() {
  background(0, 0, 0);

  fill(255, 0, 0);
  noStroke();

  for (int i=0; i < 10; i++) {
    ellipse(130+i*50, 50, 
      20, 20);
  }
} // func 

// ------------------------------------------------------------------------
// Other functions

void myFunction(float x, float y, float z) {

  // do something
  //
} // func 
//

For 3D


// 3D Sketch 

// ------------------------------------------------------------------------
// The two core functions

void setup() {
  size(800, 800, P3D);
} // func 

void draw() {
  background(0, 0, 0);
  lights();

  mySphere(400, 400, 0);
} // func 

// ------------------------------------------------------------------------
// Other functions

void mySphere(float x, float y, float z) {
  translate(x, y, z);

  fill(255, 0, 0);
  noStroke();
  sphere(100.0);
} // func 
//