Hello it's my first post and I would like to ask you if there is a way for pure data to steal all keyboard input even when the puredata window is not focused?
Glovepie was able to do that and called it swallowing, it means even if you are opening another program everything you type on the keyboard will be catched by pure data and the other program will not get anything.
-
'Swallow' keyboard key press
-
@wakodoha Unfortunately (for what you want) No. Pd correctly receives hid input to its focused window, as you say. Otherwise total chaos would ensue. You will need to find an external program (like glovepie?) that can then send the captured data to Pd through a localhost port...... so it will need to be able to send data across a network....
And then (the easy part) you would need to write a Pd patch that receives the data and interprets it as you wish!......
David. -
Thank you for the answer! I 've been looking for so long for a way to use the qwerty keyboard as a midi instrument and controller without having to focus on the program windows and only glovepie could do that but it's dead now.
Auto Hot Key should be able to swallow input but I haven't tried the midi side yet.For people curious about this, here's what I found until now that can be useful:
http://www.bome.com/products/mousekeyboard is very nice with keyboard, mouse and joystick midi control. You can also trigger chords. But the window needs to be on top to receive the keys..
http://freepiano.tiwb.com/en/ Open source and allows to self record midi. Still needs window focus.
http://www.nosuch.com/keykit/ is quite fun for the geeks. Maybe a bit similar to puredata. Needs window focus.
http://midi-control-center.software.informer.com/ Very old but a lot of midi messages and notes customization with joystick, keyboard and mouse. Need window focus.
http://www.vanilin.org/v7/7.html How frustrating! This one finally is able to swallow keys even when not in focus and you can customize the keys a bit but no midi control and no use of special keys.
-
@wakodoha Hello again.......
It is really quite a bad idea to "swallow" your hid.......... as it can be hard to "get back" to normality.....
And anyway... what are you going to "do" with your computer whilst the hid is swallowed.... does it matter if window focus is lost if you have no way of controlling the "new" top window because all hid has been swallowed?........
The simplest solution is probably an external (and cheap!) android tablet, with touchOSC sending osc messages to Pd over your network........ that way you will have a proper (although "touch") keyboard as well........
The second cheapest solution will be a midi keyboard and a midi interface for your computer.....
Sometimes it is easier....... and far more comfortable.... to buy some half-decent hardware.........
(I am not being facetious....... I think that is true (about the hardware.... (ebay!!).).............
David. -
Thanks David, I agree that midi keyboards and controllers are cheap and convenient. I also have touchOSC.
My quest with the qwerty keyboard is more for the sake of geekness than practicability.With glovepie my script would use scroll lock as a toggle: when off it's a typing computer keyboard and when on events are swallowed and turned into midi messages. I then use the mouse to control what happens on the screen.
One of my uses is that I have a second qwerty keyboard connected to the PC that is lying on the floor (the computer doesn't make the difference between 2 keyboards). With just one scroll lock press then each third of the keyboard surface is mapped to one midi note: that's how I have a puzzling looking wireless effect footswitch!
I also had a mouse footswitch in the same fashion, it's great fun to kick those interfaces. And they come for free as you can still make use of them when people discard them because some keys are defective..I'm discovering Auto Hot Key now and it seems it may be the answer to my needs.
-
does [hid/keyboard] work on windows? on osx it works even if puredata is not in focus.
[hidin]? -
Don't know how to solve your issue, but I found interesting thing to do with the solve:
http://hackaday.com/2016/03/27/turning-a-keyboard-into-a-pedal-board/ -
that hack is a great idea.
clearly i missed the second part of the question.. but still would like to know about hid on windows and if it or hidin allow keys to be detected while another program is in focus.