                 sibling!.view.superview?.insertSubview(item.view, belowSubview: sibling!.view)
             }
         }
-        
+
         onAction(.setItemVisible) {
             (item: Item, val: Bool) in
             item.view.isHidden = !val
         }
-        
+
         onAction(.setItemClip) {
             (item: Item, val: Bool) in
             item.view.clipsToBounds = val
         }
-        
+
         onAction(.setItemWidth) {
             (item: Item, val: CGFloat) in
             item.width = val
         }
-        
+
         onAction(.setItemHeight) {
             (item: Item, val: CGFloat) in
             item.height = val
         }
-        
+
         onAction(.setItemX) {
             (item: Item, val: CGFloat) in
             item.x = val
         }
-        
+
         onAction(.setItemY) {
             (item: Item, val: CGFloat) in
             item.y = val
         }
-        
+
         onAction(.setItemScale) {
             (item: Item, val: CGFloat) in
             item.scale = val
         }
-        
+
         onAction(.setItemRotation) {
             (item: Item, val: CGFloat) in
             item.rotation = val
         }
-        
+
         onAction(.setItemOpacity) {
             (item: Item, val: Int) in
             item.view.alpha = CGFloat(val) / 255
         }
-        
+
         onAction(.setItemBackground) {
             (item: Item, val: Item?) in
             item.background = val
         }
-        
+
         onAction(.setItemKeysFocus) {
-            (item: Item, val: Bool) in ()
-        }
-    }
-    
+            (item: Item, val: Bool) in
+            item.keysFocus = val
+        }
+    }
+
     var id: Int!
     let view: UIView
-    
+
     var x: CGFloat = 0 {
         didSet {
             updateTransform()
         }
     }
-    
+
     var y: CGFloat = 0 {
         didSet {
             updateTransform()
         }
     }
-    
+
     var width: CGFloat = 0 {
         didSet {
             view.frame.size.width = width

            updateTransform()
        }
    }
    
    var scale: CGFloat = 1 {
        didSet {
            updateTransform()
        }
    }
    
    var rotation: CGFloat = 0 {
        didSet {
            updateTransform()
        }
    }
    
    var background: Item? {
        didSet {
            oldValue?.view.removeFromSuperview()

            return App.getApp().renderer
        }
    }

    class func onAction(_ action: InAction, _ handler: @escaping (Reader) -> Void) {
        App.getApp().client.onAction(action, handler)
    }

    class func onAction(_ action: InAction, _ handler: @escaping () -> Void) {
        App.getApp().client.onAction(action, handler)
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T) -> Void) {
        onAction(action) {
            (reader: Reader) in
            handler(renderer.getItemFromReader(reader)! as! T)
        }
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T, Reader) -> Void) {
        onAction(action) {
            (reader: Reader) in
            handler(renderer.getItemFromReader(reader)! as! T, reader)
        }
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T, Item?) -> Void) {
        onAction(action) {
            (item: T, reader: Reader) in
            handler(item, renderer.getItemFromReader(reader))
        }
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T, Bool) -> Void) {
        onAction(action) {
            (item: T, reader: Reader) in
            handler(item, reader.getBoolean())
        }
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T, CGFloat) -> Void) {
        onAction(action) {
            (item: T, reader: Reader) in
            handler(item, reader.getFloat())
        }
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T, Int) -> Void) {
        onAction(action) {
            (item: T, reader: Reader) in
            handler(item, reader.getInteger())
        }
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T, CGColor) -> Void) {
        onAction(action) {
            (item: T, reader: Reader) in
            handler(item, Color.hexColorToCGColor(reader.getInteger()))
        }
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T, UIColor) -> Void) {
        onAction(action) {
            (item: T, reader: Reader) in
            handler(item, Color.hexColorToUIColor(reader.getInteger()))
        }
    }

    class func onAction<T: Item>(_ action: InAction, _ handler: @escaping (T, String) -> Void) {
        onAction(action) {
            (item: T, reader: Reader) in
            handler(item, reader.getString())
        }
    }

    class func register() {
        onAction(.createItem) {
            save(item: Item())
        }

        onAction(.setItemParent) {
            (item: Item, parent: Item?) in
            item.view.removeFromSuperview()
            parent?.view.addSubview(item.view)
        }

        onAction(.insertItemBefore) {
            (item: Item, sibling: Item?) in
            item.view.removeFromSuperview()
