English
Source / code snippets

inquire Joystick-Informations

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Joystick-Informations inquire
+----------------------------------------------------------+
| joystick.prf                                             |
| Author: Sebastian king                                   |
| email: feedback@sekoenig.de                              |
| Homepage: http://www.sekoenig.de                         |
| with PROFAN² whom Joystick inquire                        |
+----------------------------------------------------------+
--Benötigte functions
DEF JoySetCapture(4) !WINMM,joySetCapture
DEF JoyReleaseCapture(1) !WINMM,joyReleaseCapture
DEF JoyGetPos(2) !WINMM,joyGetPos
--Deklarationen
declare JOYINFO#     structure with Joystick-Informations
structure JOYINFO:
UINT wXpos;
UINT wYpos;
UINT wZpos;
UINT wButtons;
end
declare joyButton%
declare joyX%,joyY%,joyZ%
declare x%,y%,z%,b%
declare joyError%
--New Window
windowstyle 24
window 0,0-%maxX,%maxY
windowtitle Joystick inquire
--Joystick Capture on our Mainwindow
settle, any 100 Millisekunden data
receive
let joyError%=JoySetCapture(%hwnd,0,100,0)

if @neq(joyError%,0)

    messagebox(Error!,Joystick,48)
    end

endif

dim JOYINFO#,16  structure dimensionieren
textcolor 0,-1
drawtext 230,300ber Systemmenu terminate
drawtext 30,100,X-axis:
drawtext 30,130,Y-axis:
drawtext 30,160,Z-axis:
drawtext 30,210,Button:
let X%=@createtext(%hwnd,...,100,100,80,20)
let y%=@createtext(%hwnd,...,100,130,80,20)
let z%=@createtext(%hwnd,...,100,160,80,20)
let b%=@createtext(%hwnd,...,100,210,80,20)

while 1

    JoyGetPos(0,JOYINFO#)             Joystickdaten reading
    let joyX%=@long(JOYINFO#,0)        X-Koordinate
    let joyY%=@long(JOYINFO#,4)        Y-Koordinate
    let joyZ%=@long(JOYINFO#,8)        Z-Koordinate
    let joyButton%=@long(JOYINFO#,12)  Buttons:
    1 = Button A
    2 = Button B
    4 = Button C
    8 = Button D
    etc...
    SetText x%,@Str $(joyX%)
    SetText y%,@Str $(joyY%)
    SetText z%,@Str $(joyZ%)
    SetText b%,@st$(joyButton%)

wend

JoyReleaseCapture(0)  Capture enable
dispose joyPos#       memory enable
end
 
07/16/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.519 Views

Untitledvor 0 min.
H.Brill vor 25 Tagen
Sven Bader06/25/21
KJ09/27/14
maroro04/21/14
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie