Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. The messages used by mice and joysticks

The messages used by mice and joysticks

Scheduled Pinned Locked Moved C / C++ / MFC
game-devquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anthony Appleyard
    wrote on last edited by
    #1

    If I put these two functions in a Windows program /*-----*/ void SetTitle(HWND wn,char*S) {SendMessage(wn,WM_SETTEXT,0,(long)S);} /*-----*/ void GetTitle(HWND wn,char*S,long n) {SendMessage(wn,WM_GETTEXT,n,(long)S);} /*-----*/ these functions will set and read the window's title. If I use these to catch the mouse interrupts:- case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: case WM_RBUTTONDOWN: case WM_RBUTTONUP: case WM_RBUTTONDBLCLK: case WM_MBUTTONDOWN: case WM_MBUTTONUP: case WM_MBUTTONDBLCLK: case WM_MOUSEMOVE: {int x=short(L&0xffff),y=short(L>>16)&0xffff; char Z[64]; sprintf(Z,"{%d,%d,%2x}",x,y,S); SetTitle(wn,Z); goto DEF;} the window's title will show the current mouse return values. Please, what are the message names used to catch interrupts from a game-type joystick?, if I want to program for a joystick or similar.

    L 1 Reply Last reply
    0
    • A Anthony Appleyard

      If I put these two functions in a Windows program /*-----*/ void SetTitle(HWND wn,char*S) {SendMessage(wn,WM_SETTEXT,0,(long)S);} /*-----*/ void GetTitle(HWND wn,char*S,long n) {SendMessage(wn,WM_GETTEXT,n,(long)S);} /*-----*/ these functions will set and read the window's title. If I use these to catch the mouse interrupts:- case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: case WM_RBUTTONDOWN: case WM_RBUTTONUP: case WM_RBUTTONDBLCLK: case WM_MBUTTONDOWN: case WM_MBUTTONUP: case WM_MBUTTONDBLCLK: case WM_MOUSEMOVE: {int x=short(L&0xffff),y=short(L>>16)&0xffff; char Z[64]; sprintf(Z,"{%d,%d,%2x}",x,y,S); SetTitle(wn,Z); goto DEF;} the window's title will show the current mouse return values. Please, what are the message names used to catch interrupts from a game-type joystick?, if I want to program for a joystick or similar.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      See Processing Joystick Messages (Windows)[^] (found first time by Google).

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups