Skip to content

Commit 5ac7670

Browse files
Merge pull request #12 from TakayukiHoshi1984/modify_touch_onchange
Touch,KeyEventの記述修正
2 parents 228e66a + c9766d2 commit 5ac7670

2 files changed

Lines changed: 204 additions & 4 deletions

File tree

api/keyevent.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@
506506
"properties": {
507507
"state": {
508508
"type": "string",
509-
"title": "押されたKeyのID",
510-
"description": ""
509+
"title": "押された、もしくは離された時の状態",
510+
"description": "up:Keyが離された。<br>down:Keyが押された。"
511511
},
512512
"id": {
513513
"type": "integer",
@@ -601,4 +601,4 @@
601601
}
602602
}
603603
}
604-
}
604+
}

api/touch.json

Lines changed: 201 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,148 @@
850850
}
851851
}
852852
}
853+
},
854+
"/onTouchChange": {
855+
"get": {
856+
"operationId": "touchOnTouchChangeGet",
857+
"x-type": "one-shot",
858+
"summary": "デバイスでタッチされた座標と状態をイベントとして取得する。",
859+
"description": "プラグイン側でキャッシュしている最新のイベントメッセージを1つ取得する。",
860+
"parameters": [
861+
{
862+
"name": "serviceId",
863+
"description": "サービスID。",
864+
"in": "query",
865+
"required": true,
866+
"type": "string"
867+
}
868+
],
869+
"responses": {
870+
"200": {
871+
"description": "",
872+
"schema": {
873+
"$ref": "#/definitions/OnTouchChangeResponse"
874+
},
875+
"examples": {
876+
"application/json": {
877+
"result": 0,
878+
"product": "Example System",
879+
"version": "1.0.0",
880+
"touch": {
881+
"touches": [
882+
{
883+
"x": 192,
884+
"y": 168,
885+
"id": 0
886+
},
887+
{
888+
"x": 54,
889+
"y": 200,
890+
"id": 1
891+
}
892+
]
893+
}
894+
}
895+
}
896+
}
897+
}
898+
},
899+
"put": {
900+
"operationId": "touchOnTouchChangePut",
901+
"x-type": "event",
902+
"summary": "デバイスでタッチされた座標と状態をイベントとしての受信を開始する。",
903+
"description": "",
904+
"parameters": [
905+
{
906+
"name": "serviceId",
907+
"description": "サービスID。",
908+
"in": "formData",
909+
"required": true,
910+
"type": "string"
911+
},
912+
{
913+
"name": "interval",
914+
"description": "イベント受信間隔。単位:mSec",
915+
"in": "formData",
916+
"required": false,
917+
"type": "integer",
918+
"format": "int64"
919+
}
920+
],
921+
"responses": {
922+
"200": {
923+
"description": "",
924+
"schema": {
925+
"$ref": "#/definitions/EventRegistrationResponse"
926+
},
927+
"examples": {
928+
"application/json": {
929+
"result": 0,
930+
"product": "Example System",
931+
"version": "1.0.0"
932+
}
933+
}
934+
}
935+
},
936+
"x-event": {
937+
"schema": {
938+
"$ref": "#/definitions/OnTouchChangeEvent"
939+
},
940+
"examples": {
941+
"application/json": {
942+
"serviceId": "Host.dummyId.localhost.deviceconnect.org",
943+
"profile": "touch",
944+
"attribute": "ondoubletap",
945+
"touch": {
946+
"touches": [
947+
{
948+
"x": 192,
949+
"y": 168,
950+
"id": 0
951+
},
952+
{
953+
"x": 54,
954+
"y": 200,
955+
"id": 1
956+
}
957+
]
958+
}
959+
}
960+
}
961+
}
962+
},
963+
"delete": {
964+
"operationId": "touchOnTouchChangeDelete",
965+
"x-type": "event",
966+
"summary": "当該イベントの通知を停止する。",
967+
"description": "",
968+
"parameters": [
969+
{
970+
"name": "serviceId",
971+
"description": "サービスID。",
972+
"in": "query",
973+
"required": true,
974+
"type": "string"
975+
}
976+
],
977+
"responses": {
978+
"200": {
979+
"description": "",
980+
"schema": {
981+
"$ref": "#/definitions/EventUnregistrationResponse"
982+
},
983+
"examples": {
984+
"application/json": {
985+
"result": 0,
986+
"product": "Example System",
987+
"version": "1.0.0"
988+
}
989+
}
990+
}
991+
}
992+
}
853993
}
994+
854995
},
855996
"definitions": {
856997
"OnTouchResponse": {
@@ -949,6 +1090,25 @@
9491090
"$ref": "#/definitions/OnTouchInfo"
9501091
}]
9511092
},
1093+
"OnTouchChangeResponse": {
1094+
"type": "object",
1095+
"allOf": [{
1096+
"$ref": "#/definitions/CommonResponse"
1097+
},{
1098+
"$ref": "#/definitions/OnTouchChangeInfo"
1099+
}]
1100+
},
1101+
"OnTouchChangeEvent": {
1102+
"type": "object",
1103+
"allOf": [
1104+
{
1105+
"$ref": "#/definitions/CommonEvent"
1106+
},
1107+
{
1108+
"$ref": "#/definitions/OnTouchChangeInfo"
1109+
}
1110+
]
1111+
},
9521112
"OnTouchInfo": {
9531113
"type": "object",
9541114
"required": ["touch"],
@@ -989,6 +1149,46 @@
9891149
}
9901150
}
9911151
},
1152+
"OnTouchChangeInfo": {
1153+
"type": "object",
1154+
"required": [
1155+
"touches"
1156+
],
1157+
"properties": {
1158+
"state": {
1159+
"type": "string",
1160+
"title": "タッチの状態",
1161+
"description": "start:タッチを開始した。<br>end:タッチが終了した。<br>doubletap:ダブルタップが行われた。<br>move:タッチされ続けている。<br>cancel:タッチが中断された。<br>"
1162+
},
1163+
"touches": {
1164+
"type": "array",
1165+
"title": "タッチ情報の配列",
1166+
"description": "各タッチに関する情報の配列。",
1167+
"items": {
1168+
"type": "object",
1169+
"required": ["id", "x", "y"],
1170+
"properties": {
1171+
"id": {
1172+
"type": "integer",
1173+
"title": "ID",
1174+
"description": "タッチを開始すると割り振られる、ユニーク(唯一)な識別番号。"
1175+
},
1176+
"x": {
1177+
"type": "integer",
1178+
"title": "x座標",
1179+
"description": "デバイスが持つ空間の左上を原点としたx座標。"
1180+
},
1181+
"y": {
1182+
"type": "integer",
1183+
"title": "y座標",
1184+
"description": "デバイスが持つ空間の左上を原点としたy座標。"
1185+
}
1186+
}
1187+
}
1188+
}
1189+
1190+
}
1191+
},
9921192
"EventRegistrationResponse": {
9931193
"type": "object",
9941194
"allOf": [
@@ -1067,4 +1267,4 @@
10671267
}
10681268
}
10691269
}
1070-
}
1270+
}

0 commit comments

Comments
 (0)