# Simulate book pages turning reacting to mouse (bezier)

**URL:** https://discourse.processing.org/t/simulate-book-pages-turning-reacting-to-mouse-bezier/44284
**Category:** Coding Questions
**Created:** [April 16, 2024, 1:22am UTC](https://discourse.processing.org/t/simulate-book-pages-turning-reacting-to-mouse-bezier/44284 "2024-04-16T01:22:43Z")
**Posts on this page:** 1
**Showing post:** 17

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [April 18, 2024, 1:35pm UTC](https://discourse.processing.org/t/simulate-book-pages-turning-reacting-to-mouse-bezier/44284/17 "2024-04-18T13:35:19Z")

</div>

Hello @slacle,

_How can you balance performance and readability in your software code?_

> [@keyPressed() combos - How can I check for UP and SHIFT in a switch()](https://discourse.processing.org/t/keypressed-combos-how-can-i-check-for-up-and-shift-in-a-switch/44148/8):
>
> Hello @vkbr, This was my initial effort: boolean shiftPressed = false; void setup() { background(255, 0, 0); } void draw() { } void keyPressed() { //println(key, keyCode); switch(key) { case 'a': case 'A': println("a or A:", key); break; // Add extra key cases here } switch(keyCode) { case SHIFT: shiftPressed = true; println("shift pressed"); background(0, 255, 0); // or in draw() …

In the end you have to maintain your code and may want to share with others so the decision is yours.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/simulate-book-pages-turning-reacting-to-mouse-bezier/44284)._
