
257 P.3d 263 (2011)
STATE of Kansas, Appellee,
v.
Christopher Dwayne HALL, Appellant.
No. 102,203.
Supreme Court of Kansas.
August 12, 2011.
*264 Nancy Ogle, of Ogle Law Office, L.L.C., of Wichita, argued the cause, and was on the brief for appellant.
Jason E. Geier, assistant district attorney, argued the cause, and Chadwick J. Taylor, district attorney, and Steve Six, attorney general, were with him on the brief for appellee.
The opinion of the court was delivered by BEIER, J.:
Defendant Christopher Dwayne Hall attempts to appeal after entering guilty pleas to six felonies and one misdemeanor in Shawnee County. Hall challenges his competency to enter a plea and to be sentenced. Hall also alleges that the district judge did not properly advise him of the maximum penalty for first-degree murder. We dismiss Hall's appeal of his convictions for lack of jurisdiction. We affirm his sentence on the merits.
A brief review of the factual and procedural background is necessary to understand the context of our decision.
Hall was charged with aggravated battery, two counts of attempted murder in the first-degree, conspiracy to commit aggravated robbery, murder in the first-degree, aggravated indecent liberties with a child, and criminal desecration of a body. The charges stemmed from two different sets of events.
On December 25, 2006, Hall and his two brothers went to the home of Michael Joseph Delaney with plans to rob Delaney. One of them hit Delaney with a hammer, and another hit Jennifer Leigh Hughes, Delaney's girl-friend, *265 with another hammer. Hall later returned with one of his brothers, and the two of them hit Delaney and Hughes with the hammers again, including hitting each in the head. They then removed a safe from Delaney's apartment.
About 2 weeks earlier, Hall had sex with a minor, N.W.; strangled her; and hid her body in a closet. Hall and his brothers then transported N.W.'s body in a trash can to Lake Shawnee, poured gasoline on the body, and lit it on fire. Hall's DNA ultimately was found inside N.W.
The district court conducted a hearing on Hall's competency on December 5, 2007, when the parties stipulated to a November 29, 2007, evaluation report. The report determined that Hall was incompetent to stand trial, and the district judge agreed. The judge ordered Hall committed to Larned State Security Hospital for evaluation, treatment, and care.
While Hall was at Larned, Dr. David Landers completed a forensic evaluation on Hall. His report, dated May 23, 2008, determined that Hall was competent to stand trial and assist in his own defense. Larned discharged Hall on May 28, 2008.
The district judge held a second competency hearing on the consolidated cases on June 18, 2008. The parties stipulated to the Landers report, and the district judge found Hall competent to stand trial.
Thirteen months later, Hall's counsel filed a motion for mental examination pursuant to K.S.A. 22-3219 and K.S.A. 22-4508. K.S.A. 22-3219 deals with the defense of lack of mental state by reason of mental disease or defect at the time of the charged crime or crimes. K.S.A. 22-4508 deals with the procedure to obtain funds for expert or other services for a criminal defendant. Neither statute deals with a defendant's competence to stand trial or assist counsel. Nevertheless, in his motion, counsel noted that he had experienced difficulty communicating with Hall and that he was unsure Hall fully comprehended counsel's advice or the severity of the situation. The motion requested that Dr. George Hough perform an additional psychological evaluation of Hall. The district court granted the motion for evaluation.
Hough completed his evaluation of Hall on September 18, 2008. Based on his review of the case records, including the two earlier reports, as well as his own interview, Hough concluded that Hall probably suffered from paranoid schizophrenia, major depression, dissociative disorder, and antisocial personality disorder. Hough described Hall as "flagrantly psychotic" and "barely interviewable." Hough concluded that Hall was "clearly very psychiatrically impaired" but that "there was also evidence from the testing... that Mr. Hall is also embellishing his symptom presentation."
Apparently lacking an understanding of his limited role in this case, i.e., support for a mental disease or defect defense, Hough also opined on Hall's competency to stand trial. Hough stated: "Despite his level of severe disturbance, he does know that he has been charged with a serious crime and the potential consequence he faces if found guilty; he knows the roles and functions of the officers of the Court; and he has a working relationship with his attorney." Hough concluded that Hall was competent to stand trial.
One day after Hough drew his conclusions but before those conclusions reached the parties or the district judge, Hall pleaded guilty on all counts charged. The plea agreement specifically stated that there were no agreements as to sentencing and set out the sentencing range for each count. The agreement also stated that first-degree murder was "an `off-grid' person felony with a sentence of `life'" and a presumption that the sentence would be served in prison. In the agreement, Hall affirmed that he had discussed his legal options with his attorney, that it was his own voluntary decision to accept the plea, and that he was not under duress or coercion. He further affirmed:
"My mind is clear and I am not presently under the influence of alcohol or drugs or under a doctor's care for mental, emotional, or psychological conditions which would in any way affect my ability to make a reasoned and well-informed judgment or decision, and I know of no reason why my mental competence at the time of the commission *266 of these offense[s] or at the present time should be questioned. I am satisfied that I am in full possession of my faculties and well able to make sound and reasoned decisions as to what is in my best interest."
In addition, Hall affirmed that he understood the contents of the plea agreement and the consequences of his plea.
At the plea hearing, Hall confirmed in court that he had been given a chance to review the plea agreement with his attorney; that he had signed the written plea agreement; that he understood the agreement; and that he intended to be bound by the agreement. During the plea hearing, the district judge went through each count and the sentencing guidelines range for each offense with Hall. For murder in the first-degree, the judge informed Hall the offense was an off-grid felony with a sentence of life, served in the custody of the Secretary of Corrections. The judge also confirmed that Hall understood the rights he was waiving by entering a plea of guilty. Hall's counsel went through each count and the factual basis for each count with Hall. On the count of murder in the first-degree, when asked if he committed the crime, Hall at first answered: "I don't know." After further conversation with his counsel, Hall eventually answered "yes" when asked again. The judge also asked Hall if he was under the influence of alcohol or drugs, or a doctor's care for mental, emotional, or psychological conditions that would affect his ability to make a decision. Hall informed the court he was on Celexa, Benadryl, Thorazine, Trazodone, and Toradol. But he said that he met with his attorney, reviewed the agreement, and made an informed decision to enter a plea.
The judge found that Hall had been fully advised of his rights and understood those rights he was waiving by entering a plea. The district court specifically found Hall competent to enter his plea and found him guilty on all counts.
Hall was sentenced to a hard 50 for the first-degree murder. On the two counts of attempted murder in the first-degree, the district judge sentenced Hall to 246 months and 165 months. On the counts of aggravated indecent liberties, sexual intercourse with a victim 14 to 15 years of age, and aggravated robbery, the judge sentenced Hall to 61 months each. On the count of conspiracy to commit aggravated robbery, the court sentenced Hall to 34 months, and on the count of desecration of a body, the judge sentenced Hall to 12 months. The sentences on all counts were to run consecutive. Hall's counsel did not challenge Hall's competency during sentencing.
Hall also did not file a motion to withdraw his plea pursuant to K.S.A. 22-3210(d) in the district court. Instead, he waited to argue directly to this court on appeal that the district judge erred by accepting his guilty plea and, further, that the judge erred by failing to inform him of the maximum penalty that could be imposed for first-degree murder.

ATTEMPTED CONVICTION APPEAL
Whether a defendant's guilty plea may be withdrawn is controlled by statute. K.S.A. 2010 Supp. 22-3210(d) provides:
"(1) A plea of guilty or nolo contendere, for good cause shown and within the discretion of the court, may be withdrawn at any time before sentence is adjudged.
"(2) To correct manifest injustice the court after sentence may set aside the judgment of conviction and permit the defendant to withdraw the plea."
When a defendant has filed a motion to withdraw his or her plea in the district court, pursuant to K.S.A. 22-3210, we review the district court's decision under an abuse of discretion standard. See State v. Harned, 281 Kan. 1023, Syl. ¶ 1, 135 P.3d 1169 (2006); State v. Muriithi, 273 Kan. 952, 955, 46 P.3d 1145 (2002); State v. Bey, 270 Kan. 544, Syl. ¶ 3, 17 P.3d 322 (2001).
But here Hall cannot proceed to evaluation under these standards. A defendant cannot take a direct appeal from a conviction flowing from a guilty plea. The right to take such a direct appeal is one of the rights surrendered, usually in both a written plea agreement and in open court when the plea is entered. See State v. Campbell, 273 Kan. 414, 424-25, 44 P.3d 349 (2002) (where defendant *267 fully advised on right to appeal, an agreement to waive that right may be enforced). Hall attempts to avoid this bar by saying that he was not competent to enter his plea, but he should have first raised this argument before the district court in a motion to withdraw. Only if the district court rejected that motion could Hall appeal his conviction to this court. See State v. Williams, 37 Kan.App.2d 404, 407, 153 P.3d 566, rev. denied 284 Kan. 951 (2007) (defendant may not file direct appeal from guilty plea unless defendant first files motion to withdraw plea and trial court denies motion). The reasoning behind this process on a competency issue is obvious. We simply are not equipped to decide competency in the first instance. Rather, the district judge was in the best position to judge competency at the time of Hall's plea, having seen the defendant personally. The judge also would have had the opportunity to question Hall further at a later hearing on a motion to withdraw. Although we might functionally be better equipped to address Hall's second argument for reversal of his conviction, i.e., that the district judge inadequately informed him at his plea hearing of the maximum penalty for first-degree murder because of the dispositive power of a transcript, this court still is not Hall's first stop. His guilty plea without a subsequent motion to withdraw in the direct court deprives us of appellate jurisdiction.
Hall's counsel on appeal does not appear to appreciate this point, although she demonstrates an understanding of the general procedural bar to consideration of an issue for the first time on appeal. She now argues that we should make an exception, at least on the competency issue, because consideration of Hall's argument "is necessary to serve the ends of justice or to prevent denial of fundamental rights." State v. Shopteese, 283 Kan. 331, 339, 153 P.3d 1208 (2007). At oral argument, she, for the first time, cited our decision in State v. Davis, 281 Kan. 169, 176, 130 P.3d 69 (2006), for the proposition that trying or sentencing an incompetent defendant violates due process. Davis also stands for the proposition that, if a defendant requests a competency determination pursuant to K.S.A. 22-3302(1), a court must suspend any further criminal proceedings until a competency hearing is conducted. 281 Kan. at 177, 130 P.3d 69.
Davis has no application here. At the time of Hall's plea hearing, although Hough's evaluation result was still pending and the district judge made a competency finding, there actually was no competency-to-stand-trial issue pending. Hough's evaluation had been sought under K.S.A. 22-3219, authorizing the defense of lack of mental state to commit the crimes. Hall had not made his request for evaluation under K.S.A. 22-3302(1), which would have triggered the requirement to suspend proceedings. Then, at his plea hearing, Hall surrendered any right he had to appeal his conviction without first attempting to withdraw his plea in the district court. As stated above, without such an effort, this court lacks jurisdiction to review the merits of Hall's claim that he was incompetent to enter his plea. See Williams, 37 Kan.App.2d at 407, 153 P.3d 566.
Hall's appeal of his conviction must be dismissed for lack of jurisdiction.

SENTENCING APPEAL
Hall also now argues that he was incompetent to be sentenced on the first-degree murder. Again, this was not raised below. But our appellate consideration is not foreclosed by an absence of jurisdiction. A guilty plea does not surrender a defendant's right to appeal a sentence. See State v. Patton, 287 Kan. 200, 226, 195 P.3d 753 (2008) (citing State v. Phinney, 280 Kan. 394, 398, 122 P.3d 356 [2005]) (defendant pleading guilty may still challenge sentence imposed in some circumstances). And first-degree murder is an off-grid crime unaffected by the statutory ban on appeals of presumptive sentences. See K.S.A. 21-4721(c)(1). Given Davis, identification of competency as a fundamental due process concern, we dispense with our purely prudential reluctance to reach an issue not presented in district court and move to the merits.
According to the record before us, as mentioned, Hough's report of his evaluation did not reach the parties or the district judge before Hall pleaded guilty as charged. But *268 it did reach all concerned before sentencing. And, even though Hough's evaluation had been sought to support a mental disease or defect defense rather than a competency challenge, it addressed Hall's competency. Hough concluded that, despite Hall's substantial mental health deficiencies, Hall was competent and could assist in his defense. The transcript of Hall's sentencing does not persuade us that the district judge should have concluded otherwise, particularly with no prompting from the defense.
Defendant Christopher Dwayne Hall's appeal of his convictions is dismissed. His sentence is affirmed.
BRUCE T. GATTERMAN, District Judge, assigned.
