Example #1
0
 def type_action(self):
     if self._type.value == 1:
         key_actions.num_to_key(1)
         key_actions.minus()
         key_actions.string_to_key('gongnengxing')
     elif self._type.value == 3:
         key_actions.num_to_key(3)
         key_actions.minus()
         key_actions.string_to_key('yiyongxing')
     key_actions.space()
     key_actions.hold_time()
Example #2
0
 def person_action(self):
     x = 0
     for x in range(5):
         key_actions.right()
         x += 1
     x = 0
     for x in range(5):
         key_actions.back()
         x += 1
     pinyin_list = lazy_pinyin(self._person.value)
     pinyin = (reduce(self.add_str, pinyin_list))
     key_actions.string_to_key(pinyin)
     key_actions.space()
     key_actions.hold_time()
Example #3
0
 def level_action(self):
     if self._level.value == 1:
         key_actions.num_to_key(1)
         key_actions.minus()
         key_actions.string_to_key('guanjian')
     elif self._level.value == 2:
         key_actions.num_to_key(2)
         key_actions.minus()
         key_actions.string_to_key('yanzhong')
     elif self._level.value == 3:
         key_actions.num_to_key(3)
         key_actions.minus()
         key_actions.string_to_key('pingjun')
     elif self._level.value == 4:
         key_actions.num_to_key(4)
         key_actions.minus()
         key_actions.string_to_key('jiaoqing')
     key_actions.space()
     key_actions.hold_time()
Example #4
0
 def product_action(self):
     length_of_letter = check(self._product.value)
     if length_of_letter == 0:
         pinyin_list = lazy_pinyin(self._product.value)
         pinyin = (reduce(self.add_str, pinyin_list))
         key_actions.string_to_key(pinyin)
         key_actions.space()
         key_actions.hold_time()
     else:
         letter_part = self._product.value[:length_of_letter]
         chinese_part = self._product.value[length_of_letter:]
         key_actions.caps()
         key_actions.string_to_key(letter_part)
         key_actions.caps()
         if len(chinese_part):
             pinyin_list = lazy_pinyin(chinese_part)
             pinyin = (reduce(self.add_str, pinyin_list))
             key_actions.string_to_key(pinyin)
             key_actions.space()
         key_actions.hold_time()