summaryrefslogtreecommitdiff
path: root/meta/3rd/Cocos4.0/library/cc/Controller.lua
blob: 6ed4b19ce66040e6cdbd559e4b2430437cf6ffa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---@meta

---@class cc.Controller 
local Controller={ }
cc.Controller=Controller




---* Activate receives key event from external key. e.g. back,menu.<br>
---* Controller receives only standard key which contained within enum Key by default.<br>
---* warning The API only work on the android platform for support diversified game controller.<br>
---* param externalKeyCode   External key code.<br>
---* param receive   True if external key event on this controller should be receive, false otherwise.
---@param externalKeyCode int
---@param receive boolean
---@return self
function Controller:receiveExternalKeyEvent (externalKeyCode,receive) end
---* Gets the name of this Controller object.
---@return string
function Controller:getDeviceName () end
---* Indicates whether the Controller is connected.
---@return boolean
function Controller:isConnected () end
---* Gets the Controller id.
---@return int
function Controller:getDeviceId () end
---* Changes the tag that is used to identify the controller easily.<br>
---* param tag   A integer that identifies the controller.
---@param tag int
---@return self
function Controller:setTag (tag) end
---* Returns a tag that is used to identify the controller easily.<br>
---* return An integer that identifies the controller.
---@return int
function Controller:getTag () end
---* Start discovering new controllers.<br>
---* warning The API has an empty implementation on Android.
---@return self
function Controller:startDiscoveryController () end
---* Stop the discovery process.<br>
---* warning The API has an empty implementation on Android.
---@return self
function Controller:stopDiscoveryController () end
---* Gets a Controller object with device ID.<br>
---* param deviceId   A unique identifier to find the controller.<br>
---* return A Controller object.
---@param deviceId int
---@return self
function Controller:getControllerByDeviceId (deviceId) end
---* Gets a Controller object with tag.<br>
---* param tag   An identifier to find the controller.<br>
---* return A Controller object.
---@param tag int
---@return self
function Controller:getControllerByTag (tag) end