To solve this optimization problem, we first need to define the decision variables and the objective function. Let's denote:

- \(R\) as the number of regular keyboards made each day.
- \(M\) as the number of mechanical keyboards made each day.

The objective is to maximize profit. Given that the factory makes a profit of $30 per regular keyboard and $60 per mechanical keyboard, the objective function can be written as:

\[ \text{Maximize:} \quad 30R + 60M \]

Now, let's list the constraints based on the problem description:

1. Demand for regular keyboards: \( R \geq 165 \)
2. Demand for mechanical keyboards: \( M \geq 70 \)
3. Production limit for regular keyboards: \( R \leq 300 \)
4. Production limit for mechanical keyboards: \( M \leq 150 \)
5. Contract requirement: \( R + M \geq 250 \)

All variables are non-negative since the number of keyboards cannot be negative.

To translate this into Gurobi code in Python, we will use the Gurobi library to define our model, variables, objective function, and constraints, and then solve it.

```python
from gurobipy import *

# Create a new model
m = Model("Keyboard_Factory")

# Define variables
R = m.addVar(lb=0, name="Regular_Keyboards")
M = m.addVar(lb=0, name="Mechanical_Keyboards")

# Objective function: Maximize profit
m.setObjective(30*R + 60*M, GRB.MAXIMIZE)

# Constraints
m.addConstr(R >= 165, "Demand_Regular")
m.addConstr(M >= 70, "Demand_Mechanical")
m.addConstr(R <= 300, "Production_Limit_Regular")
m.addConstr(M <= 150, "Production_Limit_Mechanical")
m.addConstr(R + M >= 250, "Contract_Requirement")

# Solve the model
m.optimize()

# Print solution
if m.status == GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Regular Keyboards: {R.x}")
    print(f"Mechanical Keyboards: {M.x}")
    print(f"Maximum Profit: {m.objVal}")
else:
    print("No optimal solution found.")

```