Fengist, Ashley, Thank you!
Fengist: I'm not a native speaker, so I miss the subtle difference between English words, but 'functional' is indeed a better word to describe what I want. :-)
So I have to put all keyboard events in all layouts. In my project this seems like a lot of double code. Maybe I made my example to simple, so I try to explain myself better:
- I'm making a game for children with a motor disability, so they have to access it by keyboard.
- It's a game about recognizing colors.
- They can choose a color by the corresponding key (r: red, g: green, y: yellow, p: purple, ...).
- On layout1 when they press 'r' a red balloon pops.
On layout2 when they press 'r', the red airplane makes a loop,
on layout3 when they press 'r' the red helicopter flies away, ...
- So every layout contains a keyboard event and a corresponding function:
My current "common Eventsheet" contains:
Keyboard(On [r] Pressed) -→ keyPressed(Red)
Keyboard(On [o] Pressed) -→ keyPressed(Orange)
Keyboard(On [g] Pressed) -→ keyPressed(Green)
Keyboard(On Pressed) -→ keyPressed(Blue)
Keyboard(On
Pressed) -→ keyPressed(Purple)
Keyboard(On [y] Pressed) -→ keyPressed(Yellow)
Keyboard(On [w] Pressed) -→ keyPressed(White)
When I define this in every layout I get:
On ES1:
Keyboard(On [r] Pressed) -→ keyPressed1(Red)
Keyboard(On [o] Pressed) -→ keyPressed1(Orange)
Keyboard(On [g] Pressed) -→ keyPressed1(Green)
Keyboard(On Pressed) -→ keyPressed1(Blue)
Keyboard(On
Pressed) -→ keyPressed1(Purple)
Keyboard(On [y] Pressed) -→ keyPressed1(Yellow)
Keyboard(On [w] Pressed) -→ keyPressed1(White)
On ES2:
Keyboard(On [r] Pressed) -→ keyPressed2(Red)
Keyboard(On [o] Pressed) -→ keyPressed2(Orange)
Keyboard(On [g] Pressed) -→ keyPressed2(Green)
Keyboard(On Pressed) -→ keyPressed2(Blue)
Keyboard(On
Pressed) -→ keyPressed2(Purple)
Keyboard(On [y] Pressed) -→ keyPressed2(Yellow)
Keyboard(On [w] Pressed) -→ keyPressed2(White)
...
Is this the most functional way?