Also...
You declare 'int dc[5]' but that means that 'dc' has valid indices at 'dc[0]', 'dc[1]', 'dc[2]', 'dc[3]', and 'dc[4]'. Your reference to 'dc[5]' actually points to some other location which indicates that this is a logical error in your program.
To pick up on a point that betwixt makes at the end of his post, having a sequence that you must send to perform some action is fine, but you also need to consider how you will handle errors, especially as the characters are being typed on a keyboard by a person. What should you do when the user types an unexpected character etc.? Should the characters be typed within a given period of time? Even if the ultimate goal is to have some other device send these characters, then you need to think about these things in case of communications failures, noise generating wrong characters and so on.
Susan