Difference between revisions of "GetAltControl"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>JlnHd0
m
imported>Haama
(→‎Notes: Fixed script to use 65535 io -1)
 
(5 intermediate revisions by 3 users not shown)
Line 15: Line 15:
==Notes==
==Notes==


* This function returns a number which is (255   MouseButtonID*256). The left mouse button has an ID of 0, the right an ID of 1, the middle 2 and so on up to a maximum of 7.
* This function returns a number which is (255 + MouseButtonID*256). The left mouse button has an ID of 0, the right an ID of 1, the middle 2 and so on up to a maximum of 7.
* If there is no button bound to the requested control, or if the requested control is not valid, this function will return 65535. (-1, if read as a short)
* If there is no button bound to the requested control, or if the requested control is not valid, this function will return 65535.
* If you want to know which keyboard key, if any, is bound to a control, use [[GetControl]].
* If you want to know which keyboard key, if any, is bound to a control, use [[GetControl]].
* To convert the value returned by [[GetAltControl]] to a DX scancode usable with [[IsKeyPressed2]], do something like this:
* To convert the value returned by [[GetAltControl]] to a DX scancode usable with [[IsKeyPressed2]], do something like this:
<pre>short button
<pre>short button
set button to getAltControl 4 ; attack button
set button to getAltControl 4 ; attack button
if ( button != -1 )
if ( button != 65535 )
   set button to ( button - 255 ) / 256   256
   set button to ( button - 255 ) / 256 + 256
endif</pre>
endif</pre>


Line 58: Line 58:


==See Also==
==See Also==
 
*[[DisableControl]]
*[[EnableControl]]
*[[GetControl]]
*[[GetControl]]
*[[IsControlPressed]]
*[[OnControlDown]]
*[[RefreshControlMap]]
*[[TapControl]]


[[Category: OBSE Functions]]
[[Category: Functions]]
[[Category: OBSE Input Functions]]
[[Category: Functions (OBSE)]]
[[Category: Input Functions]]
[[Category: Input Functions (OBSE)]]

Latest revision as of 09:49, 12 June 2008


A command for Oblivion Script Extender

Syntax:

GetAltControl id

Retrieves the mouse button bound to the requested control.

Examples[edit | edit source]

set mouseAttackButton to GetAltControl 4
set mouseBlockButton to GetAltControl 7

Notes[edit | edit source]

  • This function returns a number which is (255 + MouseButtonID*256). The left mouse button has an ID of 0, the right an ID of 1, the middle 2 and so on up to a maximum of 7.
  • If there is no button bound to the requested control, or if the requested control is not valid, this function will return 65535.
  • If you want to know which keyboard key, if any, is bound to a control, use GetControl.
  • To convert the value returned by GetAltControl to a DX scancode usable with IsKeyPressed2, do something like this:
short button
set button to getAltControl 4 ; attack button
if ( button != 65535 )
  set button to ( button - 255 ) / 256 + 256
endif

Control IDs[edit | edit source]

Forward 0
Back 1
Slide Left 2
Slide Right 3
Attack 4
Activate 5
Block 6
Cast 7
Ready Weapon 8
Crouch/Sneak 9
Run 10
Always Run 11
Auto Move 12
Jump 13
Toggle POV 14
Menu Mode 15
Rest 16
Quick Menu 17
Quick1 18
Quick2 19
Quick3 20
Quick4 21
Quick5 22
Quick6 23
Quick7 24
Quick8 25
QuickSave 26
QuickLoad 27
Grab 28

See Also[edit | edit source]