lib/vigilem/win32_api/dom/input_record_utils.rb
def lr_not_in_name(vk_name, v_scancode, b_key_down, dw_state_names)
      if vk_name == :VK_SHIFT
        if lr = InputRecordUtils.lr_location_from_name(shift_scan_code_to_location_vk[v_scancode])
          lr.downcase
        end
      else
        regexp = location_less_vks_map[vk_name]
        available_state_names = dw_state_names.grep(regexp)
        if b_key_down == 1
          if available_state_names.size == 1
            InputRecordUtils.lr_location_from_name(available_state_names.first).downcase
          elsif available_state_names.size > 1 #both pressed
            previous_match = _get_current_keys_by_key_and_type(regexp, 'keydown')
            if previous_match.size == 2 # both already pressed? repeat
              ::VDOM::Utils.dom_location_to_common_str(previous_match.last.location)
            elsif previous_match.size == 1 # must be new
              InputRecordUtils.flip_lr_sides(::VDOM::Utils.dom_location_to_common_str(previous_match.last.location).downcase)
            end
          end
        else
          if available_state_names.size == 1 # keyup and other one is currently pressed? this is the other
            InputRecordUtils.flip_lr_sides(InputRecordUtils.lr_location_from_name(available_state_names.first).downcase)
          elsif available_state_names.size == 0 # last one just released
            if not (previous_match = _get_current_keys_by_key_and_type(regexp, 'keydown')).empty?
              ::VDOM::Utils.dom_location_to_common_str(previous_match.last.location)
            end
          end
        end
        
      end
      
    end
# gets the l or r using other params than just the name
# @todo   change name
# @see    location_less_vks_map
# @param  [Symbol] vk_name
# @param  [Integer] v_scancode
# @param  [Integer] b_key_down
# @param  [Symbol<#{location_less_vks_map.keys}>]
# @return [String<'l'||'r'>]
gets the l or r using other params than just the name
gets the l or r using other params than just the name
def lr_not_in_name(vk_name, v_scancode, b_key_down, dw_state_names)
      if vk_name == :VK_SHIFT
        if lr = InputRecordUtils.lr_location_from_name(shift_scan_code_to_location_vk[v_scancode])
          lr.downcase
        end
      else
        regexp = location_less_vks_map[vk_name]
        available_state_names = dw_state_names.grep(regexp)
        if b_key_down == 1
          if available_state_names.size == 1
            InputRecordUtils.lr_location_from_name(available_state_names.first).downcase
          elsif available_state_names.size > 1 
            previous_match = _get_current_keys_by_key_and_type(regexp, 'keydown')
            if previous_match.size == 2 
              ::VDOM::Utils.dom_location_to_common_str(previous_match.last.location)
            elsif previous_match.size == 1 
              InputRecordUtils.flip_lr_sides(::VDOM::Utils.dom_location_to_common_str(previous_match.last.location).downcase)
            end
          end
        else
          if available_state_names.size == 1 
            InputRecordUtils.flip_lr_sides(InputRecordUtils.lr_location_from_name(available_state_names.first).downcase)
          elsif available_state_names.size == 0 
            if not (previous_match = _get_current_keys_by_key_and_type(regexp, 'keydown')).empty?
              ::VDOM::Utils.dom_location_to_common_str(previous_match.last.location)
            end
          end
        end
      end
    end
def lr_not_in_name ( vk_name , v_scancode , b_key_down , dw_state_names ) if vk_name == :VK_SHIFT if lr = InputRecordUtils . lr_location_from_name ( shift_scan_code_to_location_vk [ v_scancode ] ) lr . downcase end else regexp = location_less_vks_map [ vk_name ] available_state_names = dw_state_names . grep ( regexp ) if b_key_down == 1 if available_state_names . size == 1 InputRecordUtils . lr_location_from_name ( available_state_names . first ) . downcase elsif available_state_names . size > 1 previous_match = _get_current_keys_by_key_and_type ( regexp , 'keydown' ) if previous_match . size == 2 :: VDOM :: Utils . dom_location_to_common_str ( previous_match . last . location ) elsif previous_match . size == 1 InputRecordUtils . flip_lr_sides ( :: VDOM :: Utils . dom_location_to_common_str ( previous_match . last . location ) . downcase ) end end else if available_state_names . size == 1 InputRecordUtils . flip_lr_sides ( InputRecordUtils . lr_location_from_name ( available_state_names . first ) . downcase ) elsif available_state_names . size == 0 if not ( previous_match = _get_current_keys_by_key_and_type ( regexp , 'keydown' ) ) . empty? :: VDOM :: Utils . dom_location_to_common_str ( previous_match . last . location ) end end end end end
gets the l or r using other params than just the name
gets the l or r using other params than just the name
#both pressed # both already pressed? repeat # must be new # keyup and other one is currently pressed? this is the other # last one just released
None
String<'l'||'r'>
vk_name
v_scancode
b_key_down
dw_state_names
None
None
todo
None
see
None