# Interactive keyboard for a smartwatch processing

**URL:** https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726
**Category:** Coding Questions
**Tags:** homework
**Created:** [May 10, 2020, 9:51pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726 "2020-05-10T21:51:31Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![matildespinheiro](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matildespinheiro](https://discourse.processing.org/u/matildespinheiro)
#### Post date: [May 10, 2020, 9:51pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/1 "2020-05-10T21:51:31Z")

</div>

![Screenshot 2020-05-10 at 22.37.17](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/bbc2b947a26879bfb1c15a52958a1aad514b96e2.png)

How can I do this but instead of 1-100kg I wanted from a-z.  
This is how it would work:

- when you press and start dragging the letters would change
- when you release the mouse the letter on top of the row is the letter chosen

---

<div class="post-metadata">

### Author: ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)
#### Post date: [May 11, 2020, 11:55am UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/2 "2020-05-11T11:55:19Z")

</div>

Something like this:  
`char c = (char) round(map(sliderVal, sliderMin, sliderMax, 65, 90));`

---

<div class="post-metadata">

### Author: ![matildespinheiro](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matildespinheiro](https://discourse.processing.org/u/matildespinheiro)
#### Post date: [May 11, 2020, 4:02pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/3 "2020-05-11T16:02:48Z")

</div>

what does the round do in this case ?

---

<div class="post-metadata">

### Author: ![matildespinheiro](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matildespinheiro](https://discourse.processing.org/u/matildespinheiro)
#### Post date: [May 11, 2020, 4:22pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/4 "2020-05-11T16:22:52Z")

</div>

and why did you use 65 to 90 for the range of letters?

---

<div class="post-metadata">

### Author: ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)
#### Post date: [May 11, 2020, 4:43pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/5 "2020-05-11T16:43:47Z")

</div>

Hello @matildespinheiro

Check out the reference section for this type of question:

> [@matildespinheiro](#):
>
> what does the round do in this case ?

> **[Reference](https://processing.org/reference/)**
>
> Find further documentation of the Processing language

🤓

---

<div class="post-metadata">

### Author: ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)
#### Post date: [May 11, 2020, 4:48pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/6 "2020-05-11T16:48:41Z")

</div>

And this as well, can be answered via the reference section under **char()**…

🤓

---

<div class="post-metadata">

### Author: ![matildespinheiro](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matildespinheiro](https://discourse.processing.org/u/matildespinheiro)
#### Post date: [May 11, 2020, 5:28pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/7 "2020-05-11T17:28:32Z")

</div>

but how would you do this for every letter ??

---

<div class="post-metadata">

### Author: ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)
#### Post date: [May 11, 2020, 6:08pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/8 "2020-05-11T18:08:06Z")

</div>

These are the ASCII codes for characters a-z (lowercase). The round converts the output of the map() function to an `int` so we can cast it to a char using `(char)`.

---

<div class="post-metadata">

### Author: ![matildespinheiro](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matildespinheiro](https://discourse.processing.org/u/matildespinheiro)
#### Post date: [May 11, 2020, 10:20pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/9 "2020-05-11T22:20:22Z")

</div>

but this is defining the letters right? how would I define the limits for each letter to appear on the screen? Thank you for your answers.

---

<div class="post-metadata">

### Author: ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)
#### Post date: [May 12, 2020, 9:51am UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/10 "2020-05-12T09:51:33Z")

</div>

What do you mean by limits exactly? The ASCII keycodes (65 - 90) are limited by the `map()` function.

---

<div class="post-metadata">

### Author: ![matildespinheiro](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matildespinheiro](https://discourse.processing.org/u/matildespinheiro)
#### Post date: [May 13, 2020, 5:44pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726/11 "2020-05-13T17:44:07Z")

</div>

I did this for every letter but its not working idk why
