key commands in patches

Jul 29, 2009 at 2:09pm

key commands in patches

Hi Guys,

While attempting to add keystroke control to every feature in my program project, I have run into some conflicts.
I have noticed that, in presentation mode, when a number, slider object, or bpatcher (with slider) is selected with the mouse, you can use the up and down arrow keys to change the numbers (or position of the slider/bpatcher). This is handy, but I would like to be able to use the keyboard to make the selection as well as the mouse. In other words, if I press “v” then the volume slider gets selected and I can then use the arrows to adjust it.

***I have a complicated way to do this that works, but it sometimes conflicts with the built-in function. i.e. if something is “selected” with the mouse and something is selected with the keyboard, they both move.

In another situation, I have a bpatcher with the horizontal slider activated making it a sliding window of buttons. I would like to disable the arrow key function without having to lose the slider function altogether.

#44937
Jul 29, 2009 at 3:25pm

Have you tried using the “select” message. This will enable you to type directly into number boxes using the numeric or arrow keys. You could also use the tab output to trigger selecting the next ui object. In the first example use the 1/2/3 key on your keyboard to select an initial object and then tab between them. The second example shows how you can use the tab button to remove focus from an object using a scripting hack.

lh

– Pasted Max Patch, click to expand. –
#161832
Aug 6, 2009 at 2:30pm

You can disable the mouse input of any UI object in the inspector…

#161833
Aug 6, 2009 at 3:23pm

it somehow makes sense that numbox listens to up, down,
and return (as well as to numbers) since max v. 3, but
it is sometimes a pita that you always have to take care
that no numberboxes may be selected when you want to use
an arrow key with something else.

thats not what you wanted to hear, but one possible
solution is to create custom numberboxes and a custom
multislider, which do not use the arrow keys by default,
and use those instead of the maxmsp ones.

-110

.

#161834
Aug 6, 2009 at 5:02pm

Thanks guys, I think this gives me enough to finish the task of making my patch useable for the one handed musician.

Having fun!

A.D.

#161835

You must be logged in to reply to this topic.