Forums Développement Multimédia

Aller au contenu

Projet type WiiFlash

CODE PHP MySQL

1 réponse à ce sujet

#1 actaruss

    Ceinture Bleue

  • Members
  • PipPipPipPipPip
  • 86 messages

Posté 16 January 2009 - 15:47 PM

Bonjour,

Je suis sur un projet perso et j'ai grandement besoin de conseil...
J'ai vu que le site WiiFlash "http://code.google.com/p/wiiflash/" permetait d'interfacer une wiimote avec Flash.
J'aimerais faire la même chose avec les manettes filaires du jeux BUZZ (sur PS2).
Le soucis est que je suis un simple développeur Flash ... Quelles techno utiliser pour dévellopper le server qui captera les infos des manettes dans les 2 sens jusqu'à Flash ?

Une aide serait plus que précieuse ...

Meci à vous.
Franck

#2 Ldo

  • Honoris
  • PipPipPipPipPipPipPipPip
  • 9921 messages

Posté 19 January 2009 - 10:24 AM

dans le cas de la wiimote, c'est du simple javascript
à la sortie du navigateur wii, opéra avait publié les specs
dont les codes qui permettent d'exploiter les boutons en javascript

extrait de la doc pour wii :

Citation

Event detection

When the Wii remote is being used as a mouse, it fires the same events as a normal mouse would do, such as mouseover, mousemove, and mousedown, with the exception that it cannot fire the dblclick event. There is no equivalent to the right mouse button, so custom context menus cannot be used.

Many pages, and in particular games, make use of key detection. They check when the user presses a key, and run some script when that happens. Most of these pages will also work with a mouse, but some pages may still need keyboard interaction. It is not possible to use the on-screen keyboard except within a text input. The on-screen keyboard cannot pass any key events back to the page. This also means that it is not possible for the user to use modifier keys such as Shift, Ctrl, or Alt while clicking on the page.

The only key events that can be detected are those that are sent by the Wii remote buttons. Some of these perform functions that cannot be detected, but most can be detected and used by scripts. The keyCode properties of the events are not the same as the equivalent keys used by desktop, where available, because they perform the functions of desktop key combinations, not single keys. The keyCode property for these keys are as follows:

Directional control up/down/left/right
175/176/178/177 - normal keyboard uses 38/40/37/39 for arrow keys
Button A (normal select button)
13 - only functions as a key while the mouse cursor is not being used, otherwise it is left mouse button
Button B (trigger, used for panning)
171
+ and - (zoom in and out)
174 and 170
Button 1 (toggle display of toolbar)
172
Button 2 (toggle small screen rendering)
173

If the user uses a key combination, such as B+Up, these will be seen as two separate key events, but the sequence of keydown and keyup should show that a combination was used. Note that this pattern will only work if the associated keypress events are cancelled.

The keypress event can and should be cancelled if you wish to use key events to override the normal behavior of the buttons. For example, if you wish to use the directional control to provide directional response in a game, you can detect the key presses of those buttons, and use them instead of normal arrow keys. However, those buttons will attempt to scroll around the page. Either return false from the keypress event handler function, or use the preventDefault method of the event object, to prevent the scrolling. Of course, it is important to make sure that the scrolling is not actually needed by the user before you prevent it.

document.onkeypress = function (e) {
if( e.keyCode == 175 || e.keyCode == 38 ) {
moveup();
return false;
} else if( e.keyCode == 176 || e.keyCode == 40 ) {
movedown();
return false;
} else if( e.keyCode == 178 || e.keyCode == 37 ) {
moveleft();
return false;
} else if( e.keyCode == 177 || e.keyCode == 39 ) {
moveright();
return false;
}
//allow other keys to work
return true;
};

Note that button 1 can be detected, but its keypress event cannot be cancelled.

aucune idée si une telle doc existe pour les consoles de sony ...



1 utilisateur(s) li(sen)t ce sujet

0 membre(s), 1 invité(s), 0 utilisateur(s) anonyme(s)

authorised training centre

Centre de Formation Mediabox - Adobe et Apple Authorised Training Center.

Déclaré auprès de la Direction du Travail et de la Formation Professionnelle

Mediabox : SARL au capital de 62.000€ - Numéro d'activité : 11 75 44555 75 - SIRET : 49371646800035

MEDIABOX, 23, rue de Bruxelles, 75009 PARIS

FFP