The keypad on my office phone has the following layout:
   /.@ ABC DEF    GHI JKL MNO    PQRS TUV WXYZ [*]  [#] + _
Write a program that, given an input string, returns a list of instructions that my fingers need to follow in order the type/dial the message/number.
- 3 fingers (1,2 & 3) start on keys ,  and . This starting position is 0.
- The only instruction a finger receives is its new relative location.
- Once a key has been pressed, that is the finger's new starting position. Fingers do not return to their 'home row'.
- Moving a finger up the keypad's column is -1, -2 or -3, depending on where it was last used.
- Moving a finger down the keypad's column is 1, 2 or 3, depending on where it was last used.
- Keeping a finger on the same key means there is no movement (0). It is not included.
- Words which require a double letter (like 'OO' in 'BOOK' or 'DE' in CODE) will need a pause (P) between letters.
- When using Pause, the finger is not specified.
- A finger can only press the keys in its own column (1,4,7,*) (2,5,8,0) (3,6,9,#)
- Typing certain letters requires multiple keypresses. To type 'F', 3 needs to be pressed 3 times.
- Input is not case sensitive.
- Input characters not available on the keypad should be ignored. (Hyphens and parenthesis of a phone number, for example)
- Input will either be alpha or numeric - not a mixture - so no need to switch between input methods mid-stream.
- When entering numbers, Pauses aren't necessary.
- This is code-golf so shortest code in bytes wins.
To slightly simplify matters, [*] and [#] can be ignored. These will not feature in the input. But I'll buy you a beer if you do include them and get lowest byte count! (If you're in London ;-))
A list of instructions, in the following format:
[direction] [finger_number] [new_relative_location], ...
Whitespace between instructions is optional.
(123)-957 -> -11, -21, -31, 32, 21, 12 555-9273 -> 2,2,2,31,-21,11,-32 CODE GOLF -> -21,2,2, 3,3,3, -31, P, 3,3, 23, 1, 31,3,3, -22,2,2, -31,3,3 Code Golf -> -21,2,2, 3,3,3, -31, P, 3,3, 23, 1, 31,3,3, -22,2,2, -31,3,3