0

i am using react js and want that when i press Ctrl+Shift+L it print a msg in console log right now if i press ctrl+ shift msg is print but when ctrl+shift+L not Printing Anthing

Code:-

 const handleKeyDown = (event, ID) => {
        if (event.key === "Delete") {
            //alert(name);
            axios.post(`http://localhost:9763/api/setCue?Idx=${ID}`,
                {
                    method: 'post',
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'application/json',
                        'Access-control-allow-origin': '*'
                    },
                    auth: {
                        username: 'admin',
                        password: 'password'
                    }
                }).then(response => {
                    console.log("Delete.Key", response);
                }).catch(error => {
                    console.log("Error In Post Data", error);
                });
            console.log("Delete Key Press", ID);
        }
       
        if ((event.ctrlKey && event.key === "Shift") && (event.key === "Z" )) {
            console.log("hello");
        }
        //up and Down key
        const active = document.activeElement;
        active.addEventListener('keydown', function (event) {

            switch (event.key) {
                case "ArrowUp":
                    active?.previousElementSibling?.focus();
                    event.preventDefault();
                    break;
                case "ArrowDown":
                    active?.nextElementSibling?.focus();
                    event.preventDefault();
                    break;
                default: break;
            }
        });
    }

And also when i press the Delete button status goes in pending enter image description here Why when i press delete it's goes in pending status?

Plz help..

0 Answers0