Hi,
i'm a beginner/intermediate java programmer working on a client/server application as part of a lab assignment. This lab does not require a GUI but simple command line. All my features have been implemented except for one. One requirement is to have the server waiting for the client to press ^c (control + c) to end the connection between the server and the client. I know i need to write an action listener to capture this event but im not sure how to do it. I know that when using Swing, to add an action listener to a button we first create the button and then add the action listener to the button: buttonName.addActionListener(this);
Im not even sure how i would write my class to capture the "control" button being pressed plus the "c" key being pressed. It is not the case that i'm creating the "ctrl" + "c" button so how can i add a listener to this? I have googled my problem but +95% of the results return pages dealing with GUIs, and the rest just talk about action listeners in general.
Any ideas/comments would be appreciated
thanks