when the user enters text and its sent to the emulator via para2 variable can you emulate an f1 keypress <!DOCTYPE html>
<html>
<head>
    <title>Amstrad Game Selector</title>
    <style>
        /* Reset some basic elements for consistency */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        /* Body Styling */
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            min-height: 100vh;
            padding: 20px;
        }

        /* Container for Input Elements */
        .input-container {
            background-color: #ffffff;
            padding: 30px 40px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            text-align: center;
            max-width: 500px;
            width: 100%;
            margin-bottom: 30px;
        }

        /* Heading Styling */
        .input-container h2 {
            margin-bottom: 20px;
            color: #333333;
            font-size: 24px;
        }

        /* Input Field Styling */
        .input-container input[type="text"] {
            width: 100%;
            padding: 12px 20px;
            margin: 10px 0;
            border: 2px solid #ccc;
            border-radius: 4px;
            font-size: 16px;
            transition: border-color 0.3s ease;
        }

        .input-container input[type="text"]:focus {
            border-color: #007bff;
            outline: none;
        }

        /* Button Styling */
        .input-container button {
            padding: 12px 24px;
            margin-top: 10px;
            font-size: 16px;
            color: #ffffff;
            background-color: #007bff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.2s ease;
            width: 100%;
            max-width: 200px;
        }

        .input-container button:hover {
            background-color: #0056b3;
            transform: translateY(-2px);
        }

        .input-container button:active {
            transform: translateY(0);
        }

        /* Emulator iframe Styling */
        iframe#index2Frame {
            width: 100%;
            max-width: 1000px;
            height: 600px;
            border: none;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        /* Responsive Design */
        @media (max-width: 1024px) {
            iframe#index2Frame {
                height: 500px;
            }
        }

        @media (max-width: 768px) {
            .input-container {
                padding: 20px 30px;
            }

            iframe#index2Frame {
                height: 400px;
            }
        }

        @media (max-width: 480px) {
            .input-container {
                padding: 15px 20px;
            }

            .input-container h2 {
                font-size: 20px;
            }

            .input-container input[type="text"],
            .input-container button {
                font-size: 14px;
                padding: 10px 16px;
            }

            iframe#index2Frame {
                height: 300px;
            }
        }
    </style>
</head>
<body>
    <div class="input-container">
        <h2>Enter Amstrad Game Command</h2>
        <input 
            type="text" 
            id="customInput" 
            placeholder='Enter command (e.g., run"yourgame)' 
            onkeypress="handleKeyPress(event)"
        >
        <button onclick="updateIframe()">Start Game</button>
    </div>
    
    <!-- Emulator iframe -->
    <iframe 
        id="index2Frame" 
        src="index2.html?testinput" 
        sandbox="allow-scripts allow-same-origin"
        title="Amstrad Emulator"
    ></iframe>
    
    <script>
        /**
         * Updates the iframe src based on user input for param2.
         * If no input is provided, defaults to 'run"bomber3'.
         */
        function updateIframe() {
            const customInput = document.getElementById('customInput').value.trim();
            const param1 = 'sp2.dsk'; // Fixed disk file parameter
            const param2 = customInput || 'run"bomber3'; // Defaults to 'run"bomber3' if empty

            // Encode parameters to ensure they're URL-safe
            const encodedParam1 = encodeURIComponent(param1);
            const encodedParam2 = encodeURIComponent(param2);

            const iframeSrc = `index2.html?param1=${encodedParam1}&param2=${encodedParam2}`;
            const iframe = document.getElementById('index2Frame');
            iframe.src = iframeSrc;
        }

        /**
         * Handles the Enter key press within the input field to trigger iframe update.
         * @param {KeyboardEvent} event 
         */
        function handleKeyPress(event) {
            if (event.key === 'Enter') {
                updateIframe();
            }
        }
    </script>
</body>
</html>