Is there any way a macro can know either of the following?

* The last printable character TeX read from the source file
* The contents of the last character box TeX produced

Rationale: I am working on a XeLaTeX package that will support Stone Sans Phonetic, an old commercial IPA font. Stone Sans Phonetic was created before the Unicode era, and handles accents using *ligatures* rather than combining characters — that is, to put an **ø̂** on the page, you write code that prints the characters `ø` and `^` side-by-side, and the font has a ligature that combines them.

Unfortunately, some ligatures are missing. For instance, printing `n` and `^` side-by-side doesn't put an **n̂** on the page.

What I'd like to do, then, is use `\newunicodechar` to make a Unicode combining circumflex trigger a macro that does the following:

1. Determine whether the character to its left was one that will produce a ligature with `^`.
2. If it was, print a `^` in Stone Sans Unicode.
3. If it wasn't, print a Unicode combining circumflex in some fallback font.

Is this feasible? 

(FWIW, I would have expected `\lastbox` to do what I'm looking for, but this code

```
\documentclass{article}
\begin{document}
\newbox\temp
a\setbox\temp=\lastbox
\showbox\temp
\end{document}

```

shows `\temp` to be void. What am I missing, and/or is there a different way to do what I need?)