An electronic device comprising: a user interface ; at least one processor ; and at least one memory comprising computer program code and an operating system , the at least one memory and the computer program code configured to, with the at least one processor , cause the electronic device to at least: detect a proximity of a pen device to the user interface of the electronic device wherein detecting a proximity of a pen device includes detecting a wireless signal from the pen device; upon the proximity of the pen device crossing a pen proximity threshold, set a pen event flag; upon the pen event flag being set, redraw the user interface to accommodate input from the pen device , wherein redrawing the user interface to accommodate input from the pen device includes redrawing, by an application running on the electronic device, the user interface of the application to accommodate input from the pen device, wherein the application is a messaging application that is not configured to handle pen input; and wherein subsequent to the pen event flag being set, the messaging application is configured to request to use a pen-compatible control provided by the operating system to display a writing region; and to convert pen input into text which is then used by the messaging application to communicate to a user's contact in a message. a user interface ; at least one processor ; and at least one memory comprising computer program code and an operating system , the at least one memory and the computer program code configured to, with the at least one processor , cause the electronic device to at least: detect a proximity of a pen device to the user interface of the electronic device wherein detecting a proximity of a pen device includes detecting a wireless signal from the pen device; upon the proximity of the pen device crossing a pen proximity threshold, set a pen event flag; upon the pen event flag being set, redraw the user interface to accommodate input from the pen device , wherein redrawing the user interface to accommodate input from the pen device includes redrawing, by an application running on the electronic device, the user interface of the application to accommodate input from the pen device, wherein the application is a messaging application that is not configured to handle pen input; and wherein subsequent to the pen event flag being set, the messaging application is configured to request to use a pen-compatible control provided by the operating system to display a writing region; and to convert pen input into text which is then used by the messaging application to communicate to a user's contact in a message. detect a proximity of a pen device to the user interface of the electronic device wherein detecting a proximity of a pen device includes detecting a wireless signal from the pen device; upon the proximity of the pen device crossing a pen proximity threshold, set a pen event flag; upon the pen event flag being set, redraw the user interface to accommodate input from the pen device , wherein redrawing the user interface to accommodate input from the pen device includes redrawing, by an application running on the electronic device, the user interface of the application to accommodate input from the pen device, wherein the application is a messaging application that is not configured to handle pen input; and wherein subsequent to the pen event flag being set, the messaging application is configured to request to use a pen-compatible control provided by the operating system to display a writing region; and to convert pen input into text which is then used by the messaging application to communicate to a user's contact in a message. <EOS>