質問編集履歴
3
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
前提として下記の通り
|
1
|
+
前提としてキーボードを作成するため、下記の通りボタン(キー)を作成しています。
|
2
2
|
そしてキー(画面に表示したボタン)を押すとbtnDown49、離すとbtnUp49が走ります。
|
3
3
|
どうしたら、リピートをできるでしょうか?
|
4
4
|
|
2
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
前提として下記の通り、ボタンを作成しています。
|
2
|
-
そしてキーを押すとbtnDown49、離すとbtnUp49が走ります。
|
2
|
+
そしてキー(画面に表示したボタン)を押すとbtnDown49、離すとbtnUp49が走ります。
|
3
3
|
どうしたら、リピートをできるでしょうか?
|
4
4
|
|
5
5
|
•••
|
6
6
|
|
7
7
|
self.button49 = UIButton.buttonWithType(.System) as! UIButton
|
8
|
-
self.button49 = UIButton(frame: CGRectMake(myWidth * CGFloat(9), myHeight * 3 + CGFloat(4), myWidth - CGFloat(2) ,myHeight))
|
8
|
+
self.button49 = UIButton(frame: CGRectMake(myWidth * CGFloat(9), myHeight * 3 + CGFloat(4), myWidth - CGFloat(2) ,myHeight)) //ボタンのサイズと位置
|
9
9
|
self.button49.setTitleColor(UIColor.blackColor(), forState: .Normal)
|
10
10
|
self.button49.backgroundColor = UIColor.whiteColor()
|
11
11
|
self.button49.layer.cornerRadius = 5 //角丸
|
12
12
|
self.button49.layer.borderWidth = 1 //枠線
|
13
|
-
self.button49.addTarget(self, action: "btnUp49:", forControlEvents:.TouchUpInside)
|
13
|
+
self.button49.addTarget(self, action: "btnUp49:", forControlEvents:.TouchUpInside) //ボタンが離された時の処理関数をセット
|
14
|
-
self.button49.addTarget(self, action: "btnDown49:", forControlEvents:.TouchDown)
|
14
|
+
self.button49.addTarget(self, action: "btnDown49:", forControlEvents:.TouchDown) //ボタンを押した時の処理関数をセット
|
15
15
|
|
16
16
|
•••
|
17
17
|
|
18
18
|
}
|
19
19
|
func btnDown49(sender: UIButton){
|
20
|
-
fDub = false
|
20
|
+
fDub = false //ダブルクリック判定用フラグ
|
21
21
|
self.button49.backgroundColor = UIColor.blackColor()
|
22
22
|
var proxy = textDocumentProxy as! UITextDocumentProxy
|
23
|
-
proxy.deleteBackward()
|
23
|
+
proxy.deleteBackward() //バックスペース出力
|
24
|
-
SiftCange()
|
24
|
+
SiftCange() //ボタンの色判定し変更
|
25
25
|
}
|
26
26
|
func btnUp49(sender: UIButton){
|
27
|
-
self.button49.backgroundColor = UIColor.whiteColor()
|
27
|
+
self.button49.backgroundColor = UIColor.whiteColor() //ボタンの色変更
|
28
28
|
}
|
29
29
|
|
30
30
|
よろしくお願いします。
|
1
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
キーリピートをしたいんですかが、キーが押されたままの判定の仕方をしりたい
|
1
|
+
キーボード作成中です。キーリピートをしたいんですかが、キーが押されたままの判定の仕方をしりたい
|
body
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
1
|
+
前提として下記の通り、ボタンを作成しています。
|
2
|
+
そしてキーを押すとbtnDown49、離すとbtnUp49が走ります。
|
2
|
-
どうしたら
|
3
|
+
どうしたら、リピートをできるでしょうか?
|
3
4
|
|
4
|
-
|
5
5
|
•••
|
6
6
|
|
7
7
|
self.button49 = UIButton.buttonWithType(.System) as! UIButton
|