WoW:API IsShiftKeyDown: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m ({{wowapi}}, returns / result.)
m (Move page script moved page API IsShiftKeyDown to API IsShiftKeyDown without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{wowapi}}
{{wowapi}} __NOTOC__
Returns true if the shift key is currently depressed.
Returns true if the shift/ctrl/alt key is currently depressed.


  IsShiftKeyDown();
  shiftDown = IsShiftKeyDown();
ctrlDown  = IsControlKeyDown();
altDown  = IsAltKeyDown();


----
== Arguments ==
;''Arguments''
:''none''


:''none''
== Returns ==
:;Boolean : 1 (true) if the given key is currently held down, nil otherwise.


----
== Related Events ==
;''Returns''
:[[Events/M#MODIFIER_STATE_CHANGED|MODIFIER_STATE_CHANGED]] - fires when shift/ctrl/alt keys are pressed or released


:;Boolean : 1 (true) if SHIFT is currently held down, nil otherwise.
== Example ==


----
;''Example''
   if ( IsShiftKeyDown() ) then DoSomething(); end
   if ( IsShiftKeyDown() ) then DoSomething(); end


;''Result''
== Note ==
true | nil
 
These functions will only return true if one of the keys is considered a modifier. If the code executing is started with Shift/Control/Alt as part of the key binding, it will return nil.
[[User:Govtgeek|Govtgeek]] ([[User talk:Govtgeek|talk]]) 01:30, 8 March 2009 (UTC)
 
These functions actually return the value 1 at this time (when evaluated true).  After the WoD 6.0 API goes into affect the values returned will be boolean true and false (nil).

Latest revision as of 04:46, 15 August 2023

WoW API < IsShiftKeyDown

Returns true if the shift/ctrl/alt key is currently depressed.

shiftDown = IsShiftKeyDown();
ctrlDown  = IsControlKeyDown();
altDown   = IsAltKeyDown();

Arguments[edit]

none

Returns[edit]

Boolean
1 (true) if the given key is currently held down, nil otherwise.

Related Events[edit]

MODIFIER_STATE_CHANGED - fires when shift/ctrl/alt keys are pressed or released

Example[edit]

 if ( IsShiftKeyDown() ) then DoSomething(); end

Note[edit]

These functions will only return true if one of the keys is considered a modifier. If the code executing is started with Shift/Control/Alt as part of the key binding, it will return nil. Govtgeek (talk) 01:30, 8 March 2009 (UTC)

These functions actually return the value 1 at this time (when evaluated true).  After the WoD 6.0 API goes into affect the values returned will be boolean true and false (nil).