This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-03-28 07:32:48

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Connecting To Wii Remote With Fake Keys?

I'm trying to connect my mod to a Wii remote, using keys not actually on the keyboard. I think I have the Squeak part working, but I don't know what to do for the GlovePie part. Can anyone help? Here is the ascii code for each of the commands I'm using:

Code:

command=ascii
A button = 128 
B Button = 129
1= 130 
2= 131 
+= 132 
-= 133 
Home= 134 
D up= 135 
D right= 136 
D down= 137 
D left= 138 
C= 139 
Z= 140 
Joy up= 141 
Joy right=142 
Joy down=143 
Joy left= 144 
Shake=145 
Swing vertical= 146
Swing Horizontal= 147
Swing up= 148
swing right= 149
Swing down= 150
Swing left= 151
Poke= 152
Cross arms= 153
Up down arms= 154
Clockwise circle= 155
Cclockwise circle= 156

Last edited by Billybob-Mario (2011-03-28 07:33:10)

Offline

 

#2 2011-04-08 21:03:49

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

It turns out that I need to somehow trick the Squeak into reading the fake keys. Can anyone help?

Offline

 

#3 2011-04-08 22:04:53

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Connecting To Wii Remote With Fake Keys?

Simply make a new block:
<wii remote {^ } >
('wii remote %s' #b #keyPressed:)
the code? Edit the asciiFor: add:

Code:

'A button' localized = t2 ifTrue: [^ 182].

and put the rest like so. You could even just add these to the key pressed block drop-down!

Last edited by Pecola1 (2011-04-08 22:05:08)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#4 2011-04-09 14:53:10

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

Pecola1 wrote:

Simply make a new block:
<wii remote {^ } >
('wii remote %s' #b #keyPressed:)
the code? Edit the asciiFor: add:

Code:

'A button' localized = t2 ifTrue: [^ 182].

and put the rest like so. You could even just add these to the key pressed block drop-down!

I didn't add localized to it before, so I did that but it still doesn't work. Something weird happens: when I'm making a fake key be pressed, the green flag flashes, and everything gets all jumpy, like single stepping mode. That might be part of the problem.

Offline

 

#5 2011-04-11 16:09:50

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

I'm using GlovePie to press the keys using other keys (there's a problem with my bluetooth). When I use a real key to press another real key, it works fine. But when I try to press a fake key, the green flag flashes and stuff gets jumpy. Does anyone know why that happens?

Offline

 

#6 2011-04-11 16:38:43

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

For some strange reason, when you hold a fake key, it also presses something like enter, but not enter.

Edit: or maybe it is enter, at least sometimes. I'm trying to make it swallow enter, and press p instead, and sometimes it presses enter as well.

Last edited by Billybob-Mario (2011-04-12 07:19:55)

Offline

 

#7 2011-04-11 16:39:07

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Connecting To Wii Remote With Fake Keys?

Random!


You can now reach me on Twitter @johnnydean1_

Offline

 

#8 2011-04-11 17:36:49

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Connecting To Wii Remote With Fake Keys?

Nice idea... Never new you could use keys that didn't exist.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#9 2011-04-14 14:49:49

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

Does anyone know why making GlovePie press and hold Unicode 00C7 (or maybe any unicode) makes it press enter as well?

Offline

 

#10 2011-04-14 19:29:40

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

I got it to stop pressing enter by adding

Code:

Keyboard.RepeatFakeKeys = False

, but it won't pick up the fake keypresses. Can anyone help?

Offline

 

#11 2011-04-15 07:10:47

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

Here is my current test code:

Code:

if L then
Key.Unicode00C7=1
else
Key.Unicode00C7=0
endif

When I hold L, it presses Ç.

It works, but Slash doesn't pick it up. That's the real problem.

Offline

 

#12 2011-04-17 04:14:39

charm2010
New Scratcher
Registered: 2011-04-17
Posts: 4

Re: Connecting To Wii Remote With Fake Keys?

Thanks for all the great answers, I had the same exact issue been looking for a solution for a long time. Thanks

Offline

 

#13 2011-04-17 17:04:41

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

charm2010 wrote:

Thanks for all the great answers, I had the same exact issue been looking for a solution for a long time. Thanks

It still doesn't work.

Offline

 

#14 2011-04-26 19:24:47

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Connecting To Wii Remote With Fake Keys?

Bummmmmppppp

Offline

 

#15 2011-04-26 19:26:51

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Connecting To Wii Remote With Fake Keys?

Billybob-Mario wrote:

Bummmmmppppp

You must mean Bump. DONNNNNN'TT UUUUUUUSSSE TOOOOOOOOOO MAAAANNNNYYY LETTEEEEEEEERRRSSSSS.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

Board footer