Hi bluebear9048, welcome to Psych Central!
It sounds like you're describing
hyperfocus, which is sometimes associated with ADHD. It's been discussed quite a bit at PC; take a look at these
search results. The Wikipedia article on hyperfocus is more technical than I could get into. I found a much more approachable one
here.
I've never been diagnosed with anything but when I took an online quiz, it suggested I might have ADD. If I do, it doesn't seem to bother me -- or else I'm used to it. I find I regard hyperfocus much more as a talent than as a symptom. I enjoy it and find it very useful for some activities such as programming and other technical work.
I found a Bizarro (I think) cartoon several years ago that pretty well sums up how I feel about hyperfocus. A guy is sitting at a desk in what's left of an office after some huge disaster such a tornado. The walls are gone and outside you can see the ruins of other buildings. "At last!" he's saying. "Now maybe I can get something done!"