function p.input(str)
    if( str == "move forward start"     ) then ga_set_b("var.movement.forward",  true)  end
    if( str == "move forward stop"      ) then ga_set_b("var.movement.forward",  false) end
    if( str == "move back start"        ) then ga_set_b("var.movement.back",     true)  end
    if( str == "move back stop"         ) then ga_set_b("var.movement.back",     false) end
    if( str == "move left start"        ) then ga_set_b("var.movement.left",     true)  end
    if( str == "move left stop"         ) then ga_set_b("var.movement.left",     false) end
    if( str == "move right start"       ) then ga_set_b("var.movement.right",    true)  end
    if( str == "move right stop"        ) then ga_set_b("var.movement.right",    false) end

    local cur_mode = ga_get_sys_s("game.player.move.mode")
    if( cur_mode == "ground" ) then
        if( str == "move up start"           ) then ga_set_b("var.movement.jump", true) end
        if( str == "move crouch start"       ) then ga_set_b("var.movement.wants_to_crouch", true) end
        if( str == "move crouch stop"        ) then ga_set_b("var.movement.wants_to_uncrouch", true) end
        if( str == "move ledge_guard toggle" ) then
            value = ga_get_b("var.movement.ledge_guard")
            ga_set_b("var.movement.ledge_guard", not value)
        end
    end
    if( cur_mode == "fly" ) then
        if( str == "move up start"       ) then ga_set_b("var.movement.fly.up", true) end
        if( str == "move up stop"        ) then ga_set_b("var.movement.fly.up", false) end
        if( str == "move fly down start" ) then ga_set_b("var.movement.fly.down", true) end
        if( str == "move fly down stop"  ) then ga_set_b("var.movement.fly.down", false) end
    end
end

function p.update_discrete()
    local mode = ga_get_sys_s("game.player.move.mode")
    if( mode == "ground" ) then game_movement_ground.update_discrete() end
    if( mode == "fly" ) then game_movement_fly.update_discrete() end
end
